All problems
Calibration Intercept Lite
Problem
Return the calibration intercept estimate logit(observed_rate) - logit(mean_predicted) with logit(p) = ln(p/(1-p)). Return 0.0 when either input is outside (0, 1).
Hint
It compares the observed event rate with the mean predicted probability on the log-odds scale.
Test cases
case 1
in: [0.2,0.25]
expected: -0.2876820724517808
case 2
in: [0.1,0.1]
expected: 0
case 3
in: [0.5,0.2]
expected: 1.3862943611198906
case 4
in: [0,0.5]
expected: 0
case 5
in: [0.9,0.8]
expected: 0.8109302162163288
Starter codePython
import math
def calibration_intercept_lite(observed_rate, mean_predicted):
# Your code here
pass5 test cases · run your code against them in the editor