Releases: henrikbostrom/crepes
crepes 0.9.0
v0.9.0 (8/10/2025)
Features
- Conformal test martingales have been included in the new module
crepes.martingales, which defines the betting functionsEpsilonBettingFunctionandStepBettingFunction(with and without drift) as well as the martingalesSimpleJumper,SleeperStayer,SleeperDrifterandCompositeMartingale, which can be used in combination with any betting function. The new module also includes the methodsemi_online_p_valuesfor generating (smoothed) p-values from non-conformity scores in the semi-online mode. For more details, please consult the updated documentation and the newly added Jupyter notebookmartingales_nb.ipynb.
Fixes
- A minor bug in the documentation has been fixed.
crepes 0.8.0
v0.8.0 (31/03/2025)
Features
-
Semi-online inductive conformal classifiers, regressors and predictive systems, which iteratively update the calibration set after making each prediction, have been incorporated. For
WrapClassifier, the methodspredict_p,predict_setandevaluate, now include the argumentonlinetogether with the argumentwarm_start, where the former enables online calibration (disabled by default) and the latter enables extending the original calibration set during online calibration (enabled by default). Similarly, forWrapRegressor, the methodspredict_p,predict_int,predict_percentiles,predict_cpdsandevaluateinclude the argumentsonlineandwarm_start. Semi-online conformal predictors are also enabled by the methodspredict_p_online(forConformalClassifier,ConformalRegressor, andConformalPredictiveSystem),predict_set_online(forConformalClassifier),predict_int_online(forConformalRegressorandConformalPredictiveSystem),predict_percentiles_onlineandpredict_cpds_online(forConformalPredictiveSystem). Moreover, theevaluatemethod for all three types of conformal predictor now includes an additional argumentonline, which if set to true enables online calibration. -
The method
predict_pfor generating (smoothed or non-smoothed) p-values using conformal regressors has been added. -
New methods for conformal predictive systems have been added;
predict_pfor obtaining p-values,predict_intfor obtaining prediction intervals,predict_percentilesfor obtaining percentiles, andpredict_cpdsfor obtaining conformal predictive distributions. These outputs can alternatively (as before) be generated by the methodspredict(forConformalPredictiveSystem) andpredict_cps(forWrapRegressor). -
Both smoothed and non-smoothed p-values may now be output for conformal predictive systems; smoothing is the default but can be disabled by setting
smoothing=Falsefor the methodspredict_pandpredict. -
The
evaluatemethod ofConformalClassifier,ConformalRegressor, andConformalPredictiveSystem, as well as ofWrapClassifierandWrapRegressor, now includes the metricks_test, which provides the p-value for the Kolmogorov-Smirnov test of uniformity of predicted p-values. Thanks to @egonmedhatten for the suggestion!
Fixes
- Fitted objects now contain the attribute
fitted_to allow for proper handling in scikit-learn pipelines. Thanks to @lukethomrichardson for suggesting the fix.
crepes 0.7.1
v0.7.1 (21/09/2024)
Features
-
The
calibratemethods of the classesWrapClassifierandWrapRegressornow take an additional argumentseed, for setting the state of the random number generator. This allows forpredict_pandpredict_setof the former class andpredict_intandpredict_cpsof the latter class as well asevaluatefor both classes to become deterministic. The methodspredict_p,predict_set,predict_int,predict_cpsandevaluateof these classes also have an argumentseed, which can be used to over-ride any setting by thecalibratemethod. In addition, the corresponding methods of the classesConformalClassifierandConformalPredictiveSystemalso include the argumentseedfor the same purpose. (The methods ofConformalRegressorcurrently contains no stochastic components and there is hence no need for a seed.) Thanks to @egonmedhatten and @tuvelofstrom for suggesting this extension. -
The
predict_pmethods of the classesConformalClassifierandWrapClassifiernow takes an optional argumentsmoothingto allow for generating both smoothed and non-smoothed p-values (default:smoothing=True). -
The default value for the parameter
smoothingof thepredict_setandevaluatemethods has been changed toTrue. -
The class
DifficultyEstimatorincrepes.extrasnow includes a parameterffor providing a function to compute the difficulty estimates.
Fixes
- The documentation for the class
MondrianCategorizerincrepes.extrashas been corrected.
crepes 0.7.0
v0.7.0 (27/06/2024)
Features
-
The class
MondrianCategorizerwas added tocrepes.extras, for generating categories to be used by Mondrian conformal classifiers, regressors and predictive systems. See the documentation for the interface to objects of the class through thefitandapplymethods. -
The class
WrapRegressorhas been updated so that the methodcalibrateallows for specifying an (optional) difficulty estimator and (optional) Mondrian categorizer, which are used both for calibration and making predictions, instead of requiring that difficulty estimates and Mondrian categories are provided separately for these tasks. The methodspredict_int,predict_cpsandevaluateno longer requiresigmasandbinsto be provided for normalized and Mondrian conformal regressors and predictive systems. Thanks to @tuvelofstrom for suggestions along these lines. -
The class
WrapClassifierhas been updated so that the methodcalibrateallows for specifying an (optional) Mondrian categorizer, which is used both for calibration and making predictions. The methodspredict_p,predict_setandevaluateno longer requirebinsto be provided for Mondrian conformal classifiers.
Fix
- Label vectors represented by pandas.Series are converted to NumPy arrays to avoid indexing issues. Thanks to @valeman for pointing this out.
crepes 0.6.2
v0.6.2 (02/02/2024)
Fixes
- Fixed deprecated code for checking if an array is non-empty in the
ConformalPredictiveSystemclass. Thanks to @tuvelofstrom for pointing this out.
crepes 0.6.1
v0.6.1 (21/08/2023)
Features
- The function
marginfor computing non-conformity scores for conformal classifiers has been added tocrepes.extras.
Fixes
-
Fixed a bug in the
DifficultyEstimatorclass (increpes.extras), which caused an error when trying to display a non-fitted object. Thanks to @tuvelofstrom for pointing this out. -
Fixed an error in the documentation for the function
hinge. -
The Jupyter notebooks
crepes_nb_wrap.ipynbandcrepes_nb.ipynbhave been updated to illustrate the newmarginfunction.
crepes 0.6.0
v0.6.0 (28/06/2023)
Features
-
The classes
ConformalClassifierandWrapClassifierhave been added tocrepes, allowing for generation of standard and Mondrian conformal classifiers, which produce p-values and prediction sets. Thecalibratemethod ofWrapClassifierallows for easily generating class-conditional conformal classifiers and using out-of-bag calibration. See the documentation for the interface to objects of the class through thecalibrate,predict_pandpredict_setmethods, in addition to thefit,predictandpredict_probamethods of the wrapped learner. The methodevaluateallows for evaluating the predictive performance using a set of standard metrics. -
The function
hingefor computing non-conformity scores for conformal classifiers has been added tocrepes.extras.
Fixes
-
The class
Wraphas changed name toWrapRegressorand the arguments to thecalibratemethod of this class have been changed to be in line with thecalibratemethod ofWrapClassifier. -
The Jupyter notebooks
crepes_nb_wrap.ipynbandcrepes_nb.ipynbhave been updated and extended
crepes 0.5.1
v0.5.1 (22/06/2023)
Fix
- Fixed a bug in the
evaluatemethod ofConformalPredictiveSystem, which caused an error when usingCRPSas a single metric, i.e., when providingmetrics=["CRPS"]as input. Thanks to @Zeeshan-Khaliq for pointing this out.
crepes 0.5.0
Feature
- The full cpds matrix is calculated only if requested to be output (
return_cpds=True) by thepredictmethod ofConformalPredictiveSystemor if the set of metrics include "CRPS" for theevaluatemethod. This allows large test and calibration sets to be handled without excessive use of memory in other cases. Thanks to @christopherjluke and @SebastianLeborg for highlighting and discussing the problem.
Fixes
-
Default values for mandatory arguments for the methods
fit,predictandevaluatemethods ofConformalRegressorandConformalPredictiveSystem, as well as the functionbinningincrepes.extras, are no longer provided -
y_minandy_maxcorrectly inserted for all percentiles -
The
evaluatemethod forConformalPredictiveSystemfixed to work correctly even if CRPS not included in metrics, and if all test objects belong to the same Mondrian category -
Incorrect values for percentiles will render an error message
crepes 0.4.0
v0.4.0 (16/05/2023)
Feature
- The class
Wraphas been added tocrepes, allowing for easily extending the underlying learner with methods for forming, and making predictions with, conformal regressors and predictive systems. See the documentation for the interface to objects of the class through thecalibrate,predict_intandpredict_cpsmethods, in addition to thefitandpredictmethods of the wrapped learner.
Fixes
-
A Jupyter notebook
crepes_nb_wrap.ipynbhas been added to the documentation to illustrate the use of theWrapclass. -
The output result array of a conformal predictive system is converted to a vector if the array contains one column only.
-
The documentation has been updated and now includes links to classes and methods.
-
crepes.fillingshas been renamed tocrepes.extras