Releases: henrikbostrom/crepes
crepes 0.7.1
v0.7.1 (21/09/2024)
Features
-
The
calibrate
methods of the classesWrapClassifier
andWrapRegressor
now take an additional argumentseed
, for setting the state of the random number generator. This allows forpredict_p
andpredict_set
of the former class andpredict_int
andpredict_cps
of the latter class as well asevaluate
for both classes to become deterministic. The methodspredict_p
,predict_set
,predict_int
,predict_cps
andevaluate
of these classes also have an argumentseed
, which can be used to over-ride any setting by thecalibrate
method. In addition, the corresponding methods of the classesConformalClassifier
andConformalPredictiveSystem
also include the argumentseed
for the same purpose. (The methods ofConformalRegressor
currently contains no stochastic components and there is hence no need for a seed.) Thanks to @egonmedhatten and @tuvelofstrom for suggesting this extension. -
The
predict_p
methods of the classesConformalClassifier
andWrapClassifier
now takes an optional argumentsmoothing
to allow for generating both smoothed and non-smoothed p-values (default:smoothing=True
). -
The default value for the parameter
smoothing
of thepredict_set
andevaluate
methods has been changed toTrue
. -
The class
DifficultyEstimator
increpes.extras
now includes a parameterf
for providing a function to compute the difficulty estimates.
Fixes
- The documentation for the class
MondrianCategorizer
increpes.extras
has been corrected.
crepes 0.7.0
v0.7.0 (27/06/2024)
Features
-
The class
MondrianCategorizer
was 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 thefit
andapply
methods. -
The class
WrapRegressor
has been updated so that the methodcalibrate
allows 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_cps
andevaluate
no longer requiresigmas
andbins
to be provided for normalized and Mondrian conformal regressors and predictive systems. Thanks to @tuvelofstrom for suggestions along these lines. -
The class
WrapClassifier
has been updated so that the methodcalibrate
allows for specifying an (optional) Mondrian categorizer, which is used both for calibration and making predictions. The methodspredict_p
,predict_set
andevaluate
no longer requirebins
to 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
ConformalPredictiveSystem
class. Thanks to @tuvelofstrom for pointing this out.
crepes 0.6.1
v0.6.1 (21/08/2023)
Features
- The function
margin
for computing non-conformity scores for conformal classifiers has been added tocrepes.extras
.
Fixes
-
Fixed a bug in the
DifficultyEstimator
class (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.ipynb
andcrepes_nb.ipynb
have been updated to illustrate the newmargin
function.
crepes 0.6.0
v0.6.0 (28/06/2023)
Features
-
The classes
ConformalClassifier
andWrapClassifier
have been added tocrepes
, allowing for generation of standard and Mondrian conformal classifiers, which produce p-values and prediction sets. Thecalibrate
method ofWrapClassifier
allows 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_p
andpredict_set
methods, in addition to thefit
,predict
andpredict_proba
methods of the wrapped learner. The methodevaluate
allows for evaluating the predictive performance using a set of standard metrics. -
The function
hinge
for computing non-conformity scores for conformal classifiers has been added tocrepes.extras
.
Fixes
-
The class
Wrap
has changed name toWrapRegressor
and the arguments to thecalibrate
method of this class have been changed to be in line with thecalibrate
method ofWrapClassifier
. -
The Jupyter notebooks
crepes_nb_wrap.ipynb
andcrepes_nb.ipynb
have been updated and extended
crepes 0.5.1
v0.5.1 (22/06/2023)
Fix
- Fixed a bug in the
evaluate
method ofConformalPredictiveSystem
, which caused an error when usingCRPS
as 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 thepredict
method ofConformalPredictiveSystem
or if the set of metrics include "CRPS" for theevaluate
method. 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
,predict
andevaluate
methods ofConformalRegressor
andConformalPredictiveSystem
, as well as the functionbinning
increpes.extras
, are no longer provided -
y_min
andy_max
correctly inserted for all percentiles -
The
evaluate
method forConformalPredictiveSystem
fixed 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
Wrap
has 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_int
andpredict_cps
methods, in addition to thefit
andpredict
methods of the wrapped learner.
Fixes
-
A Jupyter notebook
crepes_nb_wrap.ipynb
has been added to the documentation to illustrate the use of theWrap
class. -
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.fillings
has been renamed tocrepes.extras
crepes 0.3.0
Features
-
The class
DifficultyEstimator
was added tocrepes.fillings
, incorporating functionality provided by the previous functionssigma_knn
,sigma_knn_oob
,sigma_variance
, andsigma_variance_oob
, which now are superfluous and have been removed fromcrepes.fillings
. See the documentation for the interface to objects of the class through thefit
andapply
methods. -
An option to normalize difficulty estimates, by providing
scaler=True
to thefit
method ofDifficultyEstimator
, has been included.
Fixes
-
The Jupyter notebook
crepes_nb.ipynb
has been updated to incorporate the above features -
The documentation of the crepes package and the crepes.fillings module has been updated with links to source code, additional examples and notes.
crepes 0.2.0
Features
- Modified
sigma_knn
to allow for calculating difficulty in three ways; using distances only, using standard deviation of the target and using the absolute residuals of the nearest neighbors. - Added
sigma_knn_oob
increpes.fillings
- Renamed the performance metric
efficiency
toeff_mean
(mean efficiency) and addedeff_med
(median efficiency) to theevaluate
method inConformalRegressor
andConformalPredictiveSystem
- Added warning messages for the case that the calibration set is too small for the specified confidence level or lower/higher percentiles [thanks to Geethen for highlighting this]
- Added examples in comments
- The documentation has been generated using Sphinx and resides in crepes.readthedocs.io
Fixes
- Extended type checks to include NumPy floats and integers [thanks to patpizio for pointing this out]
- Corrected a bug in the assignment of min/max values for Mondrian conformal predictive systems
- The Jupyter notebook with examples has been updated, changed name to
crepes_nb.ipynb
and moved to the docs folder - Changed the default
k
to 25 insigma_knn