calibration_report#

scikitplot.corpus.calibration_report(y_true, y_prob, *, n_bins=10, strategy='uniform')[source]#

Every calibration measure for one set of labelled probabilities.

Parameters:
y_truearray-like of shape (n_samples,)

Binary relevance labels.

y_probarray-like of shape (n_samples,)

Predicted probabilities of relevance.

n_binsint, default=10

Number of bins for the reliability table and ECE.

strategy{“uniform”, “quantile”}, default=”uniform”

See reliability_table.

Returns:
dict

n_samples, prevalence (share of relevant labels), brier_score, log_loss, expected_calibration_error and reliability (the reliability_table). JSON-serialisable except for NaN in empty bins.

Raises:
ValueError, TypeError

See reliability_table.

Parameters:
Return type:

dict[str, Any]

Notes

User. Keep prevalence with the numbers: Brier score and log loss move with it, so two reports on populations of different prevalence are not directly comparable.