log_loss_per_instance¶
- probly.metrics.log_loss_per_instance = <flextype.singledispatch.Flexdispatch object>¶
Compute the log loss
-log(p_y)of each prediction.No clipping is applied, so the loss is
infwhere the true class has probability zero.- Parameters:
y_prob – Predicted class probabilities of shape
(..., K), or a categorical distribution, whose log probabilities are used directly so that logit-parameterized distributions stay exact.y_true – Integer class labels of shape
(...), or target probabilities of shape(..., K)(array or categorical distribution) under which the expected loss is taken.
- Returns:
The loss of each prediction, of shape
(...).- Raises:
ValueError – If
y_truehas neither shape or its labels are not integers.TypeError – If
y_probis a sample of predictions.