You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The kernel calibration error (KCE) is another calibration error. It is based on real-valued
kernels on the product space $\mathcal{P} \times \mathcal{Y}$ of predictions and targets.
The KCE with respect to a real-valued kernel
$k \colon (\mathcal{P} \times \mathcal{Y}) \times (\mathcal{P} \times \mathcal{Y}) \to \mathbb{R}$
is defined1 as
where $\mathcal{B}_{k}$ is the unit ball in the
reproducing kernel Hilbert space (RKHS)
to $k$ and $Z_X$ is an artificial random variable on the target space $\mathcal{Y}$ whose
conditional law is given by
$$Z_X \,|\, P_X = \mu \sim \mu.$$
The RKHS to kernel $k$, and hence also the unit ball $\mathcal{B}_k$, consists of
real-valued functions of the form $f \colon \mathcal{P} \times \mathcal{Y} \to \mathbb{R}$.
For classification models with $m$ classes, there exists an equivalent formulation of the
KCE based on matrix-valued kernel
$\tilde{k} \colon \mathcal{P} \times \mathcal{P} \to \mathbb{R}^{m \times m}$ on
the space $\mathcal{P}$ of predictions.2 The definition above can be rewritten as
and $\mathcal{B}_{\tilde{k}}$ is the unit ball in the RKHS of $\tilde{k}$, consisting
of vector-valued functions $f \colon \mathcal{P} \to \mathbb{R}^m$. However,
this formulation applies only to classification models whereas the general
definition above covers all probabilistic predictive models.
For a large class of kernels the KCE is zero if and only if the model is
calibrated.1 Moreover, the squared KCE (SKCE) can be formulated in
terms of the kernel $k$ as
where $\mathcal{F}$ is a space of real-valued functions of the form
$f \colon \mathcal{P} \times \mathcal{Y} \to \mathbb{R}$.1 For classification models,
the [ECE](@ref ece) with respect to common distances such as the total variation distance
or the squared Euclidean distance can be formulated in this way.2
The maximum mean calibration error (MMCE)3 can be viewed as a special case of the KCE, in
which only the most-confident predictions are considered.2
Estimator
For the SKCE biased and unbiased estimators exist. In CalibrationErrors.jl
SKCE lets you construct unbiased and biased estimators with quadratic
and sub-quadratic sample complexity.