Skip to content
项目

joneswack/conformal-predictions-from-scratch

在 GitHub 查看

关于

Various Conformal Prediction methods implemented from scratch in pure NumPy for an educational purpose.

学习与教育

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Conformal Predictions from Scratch

The aim of this repository is to implement some popular Conformal Prediction methods from scratch using pure NumPy. The correctness is then verified with reference implementations from libraries like MAPIE. All of this is done with illustrative examples and thorough explanation of the code.

Why do we reimplement things from scratch? Because we want to understand the methods from ground up in order to use them with confidence in future projects where stakes may be high. This understanding is also needed for researchers who may think about coming up with novel methods on their own. Therefore, the purpose of this repository is educational.

🕵️‍♀️ What are Conformal Predictions?

Conformal Predictions have become a very popular way of equipping machine learning models with predictive uncertainty estimates. One reason for this is that they are model-agnostic meaning that previously trained (or even deployed) models can be enhanced with predictive uncertainties post hoc. Another advantage is that Conformal Predictions come with theoretical guarantees on how much of the future data to be predicted will actually fall inside the predictive bands (generally assuming exchangeability of the data). This may seem to good to be true, but makes a lot of sense when understanding how the predictions are "conformalized".

A great list of references and tutorials on the topic can be found here.

📝 The Structure of this Repository

The repository contains one Jupyter notebook per conformal prediction method, i.e., one way to obtain predictive error bands. All notebooks are located in the notebooks folder and new notebooks will be added over time.

📈 Regression

Notebook Title (Method Name) Description Academic Reference Reference Implementation
Split Conformal Prediction Conformal Predictions with fixed prediction bands obtained via (the default) absolute residual scores. Distribution-Free Predictive Inference for Regression (Section 2.2) MAPIE Regressor with AbsoluteConformityScore
Locally Weighted Conformal Prediction Conformal Predictions with variable prediction bands obtained via residual normalised scores. Distribution-Free Predictive Inference for Regression (Section 5.2) MAPIE Regressor with ResidualNormalisedScore
Conformalized Quantile Regression (CQR) Conformal Predictions with variable prediction bands obtained via quantile regression. Conformalized Quantile Regression MAPIE QuantileRegressor
Conformal Prediction Beyond Exchangeability Analysis of Conformal Predictions when the exchangeability assumption is violated. Conformal prediction beyond exchangeability Paper Code ZIP-File

探索相关项目

加载中…