// PredictLogProbas return log-probability estimates.
PredictLogProbas return log-probability estimates.
// PredictLogProbas return log - probability estimates .
func (m *BaseNB) PredictLogProbas(Xmatrix mat.Matrix, Ymutable mat.Mutable) *mat.Dense {
	X, Y := base.ToDense(Xmatrix), base.ToDense(Ymutable)
	Xraw := X.RawMatrix()
	if Y.IsEmpty() {
		fanOut := len(m.Classes)
		Y = mat.NewDense(Xraw.Rows, fanOut, nil)
	}
	base.Parallelize(runtime.GOMAXPROCS(0), Xraw.Rows, func(th, start, end int) {
		for i := start; i < end; i++ {
			jll := Y.RawRowView(i)
			m.jointLogLikelihood(jll, Xraw.Data[i*Xraw.Stride:i*Xraw.Stride+Xraw.Cols])
			logProbX := floats.LogSumExp(jll)
			floats.AddConst(-logProbX, jll)
		}
	})
	return base.FromDense(Ymutable, Y)
}
func ( m * BaseNB ) PredictLogProbas ( Xmatrix mat . Matrix , Ymutable mat . Mutable ) * mat . Dense { X , Y := base . ToDense ( Xmatrix ) , base . ToDense ( Ymutable ) Xraw := X . RawMatrix ( ) if Y . IsEmpty ( ) { fanOut := len ( m . Classes ) Y = mat . NewDense ( Xraw . Rows , fanOut , nil ) } base . Parallelize ( runtime . GOMAXPROCS ( 0 ) , Xraw . Rows , func ( th , start , end int ) { for i := start ; i < end ; i ++ { jll := Y . RawRowView ( i ) m . jointLogLikelihood ( jll , Xraw . Data [ i * Xraw . Stride : i * Xraw . Stride + Xraw . Cols ] ) logProbX := floats . LogSumExp ( jll ) floats . AddConst ( - logProbX , jll ) } } ) return base . FromDense ( Ymutable , Y ) }
PredictLogProbas return log-probability estimates.
PredictLogProbas return log - probability estimates .
//log_prob_x = logsumexp(jll, axis=1) //return jll - np.atleast_2d(log_prob_x).T