def ll(actual, predicted):
 actual = np.array(actual)
 predicted = np.array(predicted)
 err = np.seterr(all='ignore')
 score = (- ((actual * np.log(predicted)) + ((1 - actual) * np.log((1 - predicted)))))
 np.seterr(divide=err['divide'], over=err['over'], under=err['under'], invalid=err['invalid'])
 if (type(score) == np.ndarray):
  score[np.isnan(score)] = 0
 elif np.isnan(score):
  score = 0
 return score

def ll ( actual , predicted ) : actual = np . array ( actual ) predicted = np . array ( predicted ) err = np . seterr ( all = 'ignore' ) score = ( - ( ( actual * np . log ( predicted ) ) + ( ( 1 - actual ) * np . log ( ( 1 - predicted ) ) ) ) ) np . seterr ( divide = err [ 'divide' ] , over = err [ 'over' ] , under = err [ 'under' ] , invalid = err [ 'invalid' ] ) if ( type ( score ) == np . ndarray ) : score [ np . isnan ( score ) ] = 0 elif np . isnan ( score ) : score = 0 return score
computes the log likelihood .