pitci.base.SplitConformalPredictorMixin¶
-
class
pitci.base.SplitConformalPredictorMixin(model, n_bins=3)[source]¶ Bases:
objectMixin class to provide functionality to allow conformal predictors where the intervals are calibrated to different subsets of the data depending on the scaling factor values.
This class should be used with the model specific conformal predictor classes e.g.
XGBoosterLeafNodeScaledConformalPredictorto create a new class that include the split conformal predictor functionality.SplitConformalPredictorMixinshould the first class in the mulitple inheritance when creating split conformal predictor classes for specific modelling libraries.- Parameters
model (Any) – Underlying
Anymodel to generate prediction intervals with.n_bins (int) – Number of bins to split data into based on the scaling factors.
-
n_bins¶ Number of bins to split data into based off the scaling factors.
- Type
int
-
bin_quantiles¶ Quantiles of the scaling factor values that will be used to define the limits of the bins. Attribute is set when the {calibrate_link} method is run.
- Type
float
-
baseline_interval¶ Baseline intervals calibrated for each of the
n_binssubsets of the data. Set by the_calibrate_intervalmethod.- Type
list
-
scaling_factor_cut_points¶ The edges of the scaling factor bins that define the data subsets that each of the values in
baseline_intervalare calibrated on. Set by the_calibrate_intervalmethod.- Type
np.ndarray
Methods
__init__(model[, n_bins])Initialize self.