brier_loss_per_instance¶
- probly.metrics.brier_loss_per_instance(y_prob: object, y_true: object) object[source]¶
Compute the Brier loss
sum_k (p_k - [k == y])^2of each prediction.- Parameters:
y_prob – Predicted class probabilities of shape
(..., K), or a categorical distribution.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 in
[0, 2], of shape(...).- Raises:
ValueError – If
y_truehas neither shape or its labels are not integers.TypeError – If
y_probis a sample of predictions.