Conformal 0.1.0 splitconformal interval - CyrilB1531/lodestar GitHub Wiki
Lodestar.Conformal 0.1.0. This page is frozen at that release. Read the current documentation for what
mainsays now. A link to a decision or a migration page followsmain, and leaves the archive.
SplitConformal.Interval
The prediction interval around a point prediction: [ลท โ q, ลท + q].
public static (double Lower, double Upper) Interval(double prediction, double quantile)
Parameters โ prediction is the model's point prediction for one new sample. quantile is the
calibrated quantile from Quantile.
Returns โ a (double Lower, double Upper) tuple. Lower is prediction โ quantile and Upper
is prediction + quantile, in the target's own units.
Exceptions โ ArgumentOutOfRangeException when quantile is negative or NaN.
Example โ a prediction of 11.0 with a calibrated quantile of 0.4.
using Lodestar.Conformal;
(double Lower, double Upper) interval = SplitConformal.Interval(11.0, 0.4);
double lower = interval.Lower; // => 10.6
double upper = interval.Upper; // => 11.4
Remarks โ the arithmetic is the least interesting part of split conformal prediction, and that
is the point: everything that carries the guarantee already happened in Quantile. Calling this
with a quantile you computed some other way produces an interval with no guarantee at all and no
way to tell from the output.
An infinite quantile yields the whole line, which is the trivial prediction the calibration size
forced โ see Quantile and
decision 0070. A zero
quantile yields the point back, which happens when every calibration prediction was exact and is
almost always a leaking split rather than a perfect model.
The guarantee assumes exchangeability โ see the guide's Exchangeability section.
Applies to โ net10.0, netstandard2.0.
See also โ SplitConformal.AbsoluteResiduals,
SplitConformal.Quantile, the
Python equivalence table.