nonconformist API

nc

Nonconformity functions.

Nonconformity Functions

nc.BaseModelNc(model, err_func[, …]) Base class for nonconformity scorers based on an underlying model.
nc.ClassifierNc(model[, err_func, …]) Nonconformity scorer using an underlying class probability estimating model.
nc.RegressorNc(model[, err_func, …]) Nonconformity scorer using an underlying regression model.

Error Functions

nc.ClassificationErrFunc() Base class for classification model error functions.
nc.RegressionErrFunc() Base class for regression model error functions.
nc.InverseProbabilityErrFunc() Calculates the probability of not predicting the correct class.
nc.MarginErrFunc() Calculates the margin error.
nc.AbsErrorErrFunc() Calculates absolute error nonconformity for regression problems.
nc.SignErrorErrFunc() Calculates signed error nonconformity for regression problems.

icp

Inductive conformal predictors.

Classes

icp.IcpClassifier(nc_function[, condition, …]) Inductive conformal classifier.
icp.IcpRegressor(nc_function[, condition]) Inductive conformal regressor.

acp

Aggregated conformal predictors

Classes

acp.AggregatedCp(predictor[, sampler, …]) Aggregated conformal predictor.
acp.RandomSubSampler([calibration_portion]) Random subsample sampler.
acp.BootstrapSampler Bootstrap sampler.
acp.CrossSampler Cross-fold sampler.

evaluation

Evaluation of conformal predictors.

Classes

evaluation.ClassIcpCvHelper(icp[, …]) Helper class for running the cross_val_score evaluation method on IcpClassifiers.
evaluation.RegIcpCvHelper(icp[, …]) Helper class for running the cross_val_score evaluation method on IcpRegressors.

Functions

evaluation.cross_val_score(model, x, y[, …]) Evaluates a conformal predictor using cross-validation.
evaluation.run_experiment(models, csv_files) Performs a cross-validation evaluation of one or several conformal predictors on a collection of data sets in csv format.
evaluation.reg_mean_errors(prediction, y, …) Calculates the average error rate of a conformal regression model.
evaluation.class_mean_errors(prediction, y) Calculates the average error rate of a conformal classification model.
evaluation.reg_mean_size(prediction, y, …) Calculates the average prediction interval size of a conformal regression model.
evaluation.class_avg_c(prediction, y, …) Calculates the average number of classes per prediction of a conformal classification model.
evaluation.class_one_c(prediction, y, …) Calculates the rate of singleton predictions (prediction sets containing only a single class label) of a conformal classification model.
evaluation.class_mean_p_val(prediction, y, …) Calculates the mean of the p-values output by a conformal classification model.