Skip to content
EvalSuite
Documentation menu

Calibration

Calibration slope and intercept

Implementedcalibration.calibration_slope

Definition

Coefficients of a logistic regression of the outcome on the logit of the predicted probability.

Formula

logit P(y = 1) = a + b · logit(p); ideal a = 0, b = 1

Inputs and outputs

  • y_true: array of binary labels {0, 1}
  • y_prob: predicted probability of the positive class in [0, 1]

Returns: slope, intercept with confidence intervals

Assumptions

No assumptions beyond valid, aligned inputs of the documented types.

Limitations

  • Summarises calibration with two numbers; inspect the calibration curve as well.

Python API

PythonSince v0.2.0
import evalsuite as es

es.calibration_slope(y_true, y_prob)
es.calibration_intercept(y_true, y_prob)

References

  1. Cox, D. R. (1958). Two further applications of a model for binary regression. Biometrika, 45(3/4), 562–565.

Implementation status