CalibrationErrors.jl
Estimation of calibration errors.
A package for estimating calibration errors from predictions and targets.
CalibrationErrors.Bin
CalibrationErrors.Bin
CalibrationErrors.ECE
CalibrationErrors.adddata!
CalibrationErrors.calibrationerror
CalibrationErrors.unsafe_skce_eval
Distances.evaluate
CalibrationErrors.Bin
— MethodBin(predictions, targets)
Create bin of predictions
and corresponding targets
.
CalibrationErrors.Bin
— MethodBin(prediction, target)
Create bin of a signle prediction
and corresponding target
.
CalibrationErrors.ECE
— MethodECE(binning[, distance = TotalVariation()])
Create an estimator of the expected calibration error (ECE) with the given binning
algorithm and distance
function.
CalibrationErrors.adddata!
— Methodadddata!(bin::Bin, prediction, target)
Update running statistics of the bin
by integrating one additional pair of prediction
s and target
.
CalibrationErrors.calibrationerror
— Methodcalibrationerror(estimator::CalibrationErrorEstimator, data...)
Estimate the calibration error of a model from the data
set of predictions and corresponding targets using the estimator
.
The data
can be a tuple of predictions and targets or an array of tuples of predictions and targets.
CalibrationErrors.unsafe_skce_eval
— Functionunsafe_skce_eval(k, p, y, p̃, ỹ)
Evaluate
\[k((p, y), (p̃, ỹ)) - E_{z ∼ p}[k((p, z), (p̃, ỹ))] - E_{z̃ ∼ p̃}[k((p, y), (p̃, z̃))] + E_{z ∼ p, z̃ ∼ p̃}[k((p, z), (p̃, z̃))]\]
for kernel k
and predictions p
and p̃
with corresponding targets y
and ỹ
.
This method assumes that p
, p̃
, y
, and ỹ
are valid and specified correctly, and does not perform any checks.
Distances.evaluate
— Methodevaluate(distance, bin::Bin)
Evaluate the distance
between the average prediction and the distribution of targets in the bin
.