question: private double logLikelihood ( double [ ] [ ] trainYs , double [ ] [ ] probs ) { double logLikelihood = 0 ; for ( int i = 0 ; i < trainYs . length ; i ++ ) { for ( int j = 0 ; j < m_NumClasses ; j ++ ) { if ( trainYs [ i ] [ j ] == 1.0 - m_Offset ) { logLikelihood -= Math . log ( probs [ i ] [ j ] ) ; } } } return logLikelihood / ( double ) trainYs . length ; }
target:  Computes loglikelihood given class values and estimated probablities.