autointent.metrics.scoring.scoring_log_likelihood#

autointent.metrics.scoring.scoring_log_likelihood(labels, scores, eps=1e-10)#

Calculate log likelihood score for multiclass and multilabel cases.

Multiclass case: Mean negative cross-entropy for each utterance classification result:

1i=1log(s[y[i]])

where s[y[i]] is the predicted score of the i-th utterance having the ground truth label.

Multilabel case: Mean negative binary cross-entropy:

1i=1c=1C[y[i,c]log(s[i,c])+(1y[i,c])log(1s[i,c])]
Parameters:
  • labels (autointent.metrics.custom_types.LABELS_VALUE_TYPE) – Ground truth labels for each utterance.

  • scores (autointent.metrics.custom_types.SCORES_VALUE_TYPE) – For each utterance, a list containing scores for each of n_classes classes.

  • eps (float) – A small value to avoid division by zero.

Returns:

Score of the scoring metric.

Raises:

ValueError – If any scores are not in the range (0,1].

Return type:

float