api documentation

base module

base.ConformalPredictor(model)

Base class for all conformal predictors in the pitci package.

base.AbsoluteErrorConformalPredictor(model)

Conformal interval predictor for an underlying Any model using non-scaled absolute error as the nonconformity measure.

base.LeafNodeScaledConformalPredictor(model)

Conformal interval predictor for an underlying Any model using absolute error scaled by leaf node counts as the nonconformity measure.

base.SplitConformalPredictorMixin(model[, …])

Mixin 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.

lightgbm module

lightgbm.LGBMBoosterAbsoluteErrorConformalPredictor(model)

Conformal interval predictor for an underlying lgb.Booster model using non-scaled absolute error as the nonconformity measure.

lightgbm.LGBMBoosterLeafNodeScaledConformalPredictor(model)

Conformal interval predictor for an underlying lgb.Booster model using absolute error scaled by leaf node counts as the nonconformity measure.

lightgbm.LGBMBoosterSplitLeafNodeScaledConformalPredictor(model)

Conformal interval predictor for an underlying lgb.Booster model using absolute error scaled by leaf node counts as the nonconformity measure.

xgboost module

xgboost.XGBoosterAbsoluteErrorConformalPredictor(model)

Conformal interval predictor for an underlying xgb.Booster model using non-scaled absolute error as the nonconformity measure.

xgboost.XGBSklearnAbsoluteErrorConformalPredictor(model)

Conformal interval predictor for an underlying xgb.XGBRegressor or xgb.XGBClassifier model using non-scaled absolute error as the nonconformity measure.

xgboost.XGBoosterLeafNodeScaledConformalPredictor(model)

Conformal interval predictor for an underlying xgb.Booster model using absolute error scaled by leaf node counts as the nonconformity measure.

xgboost.XGBSklearnLeafNodeScaledConformalPredictor(model)

Conformal interval predictor for an underlying xgb.XGBRegressor or xgb.XGBClassifier model using absolute error scaled by leaf node counts as the nonconformity measure.

xgboost.XGBoosterSplitLeafNodeScaledConformalPredictor(model)

Conformal interval predictor for an underlying xgb.Booster model using absolute error scaled by leaf node counts as the nonconformity measure.

dispatchers module

dispatchers.get_absolute_error_conformal_predictor()

Function to return the appropriate child class of AbsoluteErrorConformalPredictor depending on the type of the model arg.

dispatchers.get_leaf_node_scaled_conformal_predictor()

Function to return the appropriate child class of LeafNodeScaledConformalPredictor depending on the type of the model arg.

dispatchers.get_split_leaf_node_scaled_conformal_predictor()

Function to return the appropriate child class inheriting from SplitConformalPredictorMixin and a child class of LeafNodeScaledConformalPredictor depending on the type of the model arg.

helpers module

helpers.gather_intervals([lower_interval, …])

Function to perform checks on passed intervals and return lower and upper intervals separately if they are passed combined in intervals_with_predictions.

helpers.check_response_within_interval(response)

Function to check the number of times a response lies within a prediction interval.

helpers.check_interval_width([…])

Function to check the distribution of prediction intervals.

helpers.prepare_prediction_interval_df(…)

Put response column and n x 3 array into a pd.DataFrame with columns; “lower”, “predictions”, “upper” and response”.

helpers.create_interval_buckets(…[, …])

Function to create a new column in a DataFrame that buckets all rows on the widthof the intervals in the DataFrame.