def capped_log10_likelihood(actual, predicted):
 actual = np.array(actual)
 predicted = np.array(predicted)
 predicted[(predicted < 0.01)] = 0.01
 predicted[(predicted > 0.99)] = 0.99
 score = (- ((actual * np.log10(predicted)) + ((1 - actual) * np.log10((1 - predicted)))))
 if (type(score) == np.ndarray):
  score[np.isnan(score)] = 0
 elif np.isnan(score):
  score = 0
 return score

def capped_log10_likelihood ( actual , predicted ) : actual = np . array ( actual ) predicted = np . array ( predicted ) predicted [ ( predicted < 0.01 ) ] = 0.01 predicted [ ( predicted > 0.99 ) ] = 0.99 score = ( - ( ( actual * np . log10 ( predicted ) ) + ( ( 1 - actual ) * np . log10 ( ( 1 - predicted ) ) ) ) ) if ( type ( score ) == np . ndarray ) : score [ np . isnan ( score ) ] = 0 elif np . isnan ( score ) : score = 0 return score
computes the capped log10 likelihood .