8000 DOC: improve Readme before v1 release (#707) · scikit-learn-contrib/MAPIE@b8705d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8705d1

Browse files
DOC: improve Readme before v1 release (#707)
Co-authored-by: FaustinPulveric <faustin.pulveric@capgemini.com>
1 parent 3efa525 commit b8705d1

File tree

2 files changed

+37
-109
lines changed

2 files changed

+37
-109
lines changed

README.rst

Lines changed: 37 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. -*- mode: rst -*-
22
3-
|GitHubActions| |Codecov| |ReadTheDocs| |License| |PythonVersion| |PyPi| |Conda| |Release| |Commits| |DOI|
3+
|GitHubActions| |Codecov| |ReadTheDocs| |License| |PythonVersion| |PyPi| |Conda| |Release| |Commits|
44

55
.. |GitHubActions| image:: https://github.com/scikit-learn-contrib/MAPIE/actions/workflows/test.yml/badge.svg
66
:target: https://github.com/scikit-learn-contrib/MAPIE/actions
@@ -30,63 +30,43 @@
3030
.. |Commits| image:: https://img.shields.io/github/commits-since/scikit-learn-contrib/mapie/latest/master
3131
:target: https://github.com/scikit-learn-contrib/MAPIE/commits/master
3232

33-
.. |DOI| image:: https://img.shields.io/badge/10.48550/arXiv.2207.12274-B31B1B.svg
34-
:target: https://arxiv.org/abs/2207.12274
35-
3633
.. image:: https://github.com/scikit-learn-contrib/MAPIE/raw/master/doc/images/mapie_logo_nobg_cut.png
3734
:width: 400
3835
:align: center
3936

4037

41-
4238
MAPIE - Model Agnostic Prediction Interval Estimator
4339
====================================================
4440

45-
**MAPIE** is an open-source Python library for quantifying uncertainties and controlling the risks of machine learning models.
46-
It is a scikit-learn-contrib project that allows you to:
47-
48-
- Easily **compute conformal prediction intervals** (or prediction sets) with controlled (or guaranteed) marginal coverage rate
49-
for regression [3,4,8], classification (binary and multi-class) [5-7] and time series [9].
50-
- Easily **control risks** of more complex tasks such as multi-label classification,
51-
semantic segmentation in computer vision (probabilistic guarantees on recall, precision, ...) [10-12].
52-
- Easily **wrap any model (scikit-learn, tensorflow, pytorch, ...) with, if needed, a scikit-learn-compatible wrapper**
53-
for the purposes just mentioned.
54-
55-
Here's a quick instantiation of MAPIE models for regression and classification problems related to uncertainty quantification
56-
(more details in the Quickstart section):
57-
58-
.. code:: python
59-
60-
# Uncertainty quantification for regression problem
61-
from mapie.regression import MapieRegressor
62-
mapie_regressor = MapieRegressor(estimator=regressor, method='plus', cv=5)
41+
🎉 MAPIE v1.0.0 is live! 🎉 You're seeing the documentation of this new version, which introduces major changes to the API. Extensive release notes are available `here <https://mapie.readthedocs.io/en/latest/v1_migration_guide.html>`_. You can switch to the documentation of previous versions using the button on the bottom right of ReadTheDoc pages.
6342

64-
.. code:: python
65-
66-
# Uncertainty quantification for classification problem
67-
from mapie.classification import MapieClassifier
68-
mapie_classifier = MapieClassifier(estimator=classifier, method='score', cv=5)
43+
**MAPIE** is an open-source Python library for quantifying uncertainties and controlling the risks of machine learning models.
6944

70-
Implemented methods in **MAPIE** respect three fundamental pillars:
45+
It allows you to:
7146

72-
- They are **model and use case agnostic**,
73-
- They possess **theoretical guarantees** under minimal assumptions on the data and the model,
74-
- They are based on **peer-reviewed algorithms** and respect programming standards.
47+
- Easily **compute conformal prediction intervals (or prediction sets)** for regression [3,4,8], classification (binary and multi-class) [5-7],
48+
and time series [9] with guaranteed coverage rates by using the conformity set to estimate conformity scores.
49+
- Easily **control risks** of more complex tasks such as multi-label classification,
50+
semantic segmentation in computer vision, providing probabilistic guarantees on metrics like recall and precision [10-12].
51+
- Easily **integrate with any model (scikit-learn, TensorFlow, PyTorch) using a scikit-learn-compatible wrap 8000 per** if needed. MAPIE is part of the scikit-learn-contrib ecosystem.
7552

76-
**MAPIE** relies notably on the field of *Conformal Prediction* and *Distribution-Free Inference*.
53+
.. image:: https://raw.githubusercontent.com/scikit-learn-contrib/MAPIE/refs/heads/master/doc/images/educational_visual.png
54+
:width: 500
55+
:align: center
7756

57+
MAPIE relies notably on the fields of Conformal Prediction and Distribution-Free Inference. It implements **peer-reviewed** algorithms that are **model and use case agnostic** and possesses **theoretical guarantees** under minimal assumptions on the data and the model.
7858

79-
🔗 Requirements
80-
===============
8159

82-
- **MAPIE** runs on Python 3.7+.
83-
- **MAPIE** stands on the shoulders of giants. Its only internal dependencies are `scikit-learn <https://scikit-learn.org/stable/>`_ and `numpy=>1.21 <https://numpy.org/>`_.
60+
🛠 Requirements & installation
61+
=================================
8462

63+
MAPIE runs on:
8564

86-
🛠 Installation
87-
===============
65+
- Python >=3.9, <3.12
66+
- NumPy >=1.23
67+
- scikit-learn >=1.4
8868

89-
**MAPIE** can be installed in different ways:
69+
MAPIE can be installed in different ways:
9070

9171
.. code:: sh
9272
@@ -95,86 +75,36 @@ Implemented methods in **MAPIE** respect three fundamental pillars:
9575
$ pip install git+https://github.com/scikit-learn-contrib/MAPIE # or directly from the github repository
9676
9777
98-
⚡ Quickstart
99-
=============
100-
101-
Here we propose two basic uncertainty quantification problems for regression and classification tasks with scikit-learn.
102-
103-
As **MAPIE** is compatible with the standard scikit-learn API, you can see that with just these few lines of code:
104-
105-
- How easy it is **to wrap your favorite scikit-learn-compatible model** around your model.
106-
- How easy it is **to follow the standard sequential** ``fit`` and ``predict`` process like any scikit-learn estimator.
107-
108-
.. code:: python
109-
110-
# Uncertainty quantification for regression problem
111-
import numpy as np
112-
from sklearn.linear_model import LinearRegression
113-
from sklearn.datasets import make_regression
114-
from sklearn.model_selection import train_test_split
78+
⚡ Quickstart and documentation
79+
=======================================
11580

116-
from mapie.regression import MapieRegressor
81+
Below are two simple examples from `our documentation <https://mapie.readthedocs.io/en/latest/>`_ that show how MAPIE is used in a regression setting and a classification setting:
11782

83+
- `Uncertainty quantification for a regression problem <https://mapie.readthedocs.io/en/latest/examples_regression/1-quickstart/plot_toy_model.html>`_
11884

119-
X, y = make_regression(n_samples=500, n_features=1)
120-
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5)
121-
122-
regressor = LinearRegression()
123-
124-
mapie_regressor = MapieRegressor(estimator=regressor, method='plus', cv=5)
125-
126-
mapie_regressor = mapie_regressor.fit(X_train, y_train)
127-
y_pred, y_pis = mapie_regressor.predict(X_test, alpha=[0.05, 0.32])
128-
129-
.. code:: python
130-
131-
# Uncertainty quantification for classification problem
132-
import numpy as np
133-
from sklearn.linear_model import LogisticRegression
134-
from sklearn.datasets import make_blobs
135-
from sklearn.model_selection import train_test_split
136-
137-
from mapie.classification import MapieClassifier
138-
139-
140-
X, y = make_blobs(n_samples=500, n_features=2, centers=3)
141-
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5)
142-
143-
classifier = LogisticRegression()
144-
145-
mapie_classifier = MapieClassifier(estimator=classifier, method='score', cv=5)
146-
147-
mapie_classifier = mapie_classifier.fit(X_train, y_train)
148-
y_pred, y_pis = mapie_classifier.predict(X_test, alpha=[0.05, 0.32])
149-
150-
151-
📘 Documentation
152-
================
153-
154-
The full documentation can be found `on this link <https://mapie.readthedocs.io/en/latest/>`_.
155-
85+
- `Uncertainty quantification for a classification problem <https://mapie.readthedocs.io/en/latest/examples_classification/1-quickstart/plot_quickstart_classification.html>`_
15686

15787
📝 Contributing
15888
===============
15989

16090
You are welcome to propose and contribute new ideas.
16191
We encourage you to `open an issue <https://github.com/scikit-learn-contrib/MAPIE/issues>`_ so that we can align on the work to be done.
16292
It is generally a good idea to have a quick discussion before opening a pull request that is potentially out-of-scope.
163-
For more information on the contribution process, please go `here <https://github.com/scikit-learn-contrib/MAPIE/blob/master/CONTRIBUTING.rst>`_.
93+
For more information on the contribution process, read our `contribution guidelines <https://github.com/scikit-learn-contrib/MAPIE/blob/master/CONTRIBUTING.rst>`_.
16494

16595

16696
🤝 Affiliations
16797
================
16898

169-
MAPIE has been developed through a collaboration between Capgemini, Quantmetry, Michelin, ENS Paris-Saclay,
99+
MAPIE has been developed through a collaboration between Capgemini Invent, Quantmetry, Michelin, ENS Paris-Saclay,
170100
and with the financial support from Région Ile de France and Confiance.ai.
171101

172-
|Capgemini| |Quantmetry| |Michelin| |ENS| |Confiance.ai| |IledeFrance|
102+
|Capgemini Invent| |Quantmetry| |Michelin| |ENS| |Confiance.ai| |IledeFrance|
173103

174-
.. |Capgemini| image:: https://www.capgemini.com/wp-content/themes/capgemini2020/assets/images/logo.svg
104+
.. |Capgemini Invent| image:: https://www.capgemini.com/wp-content/themes/capgemini2020/assets/images/capgemini-invent.svg
175105
:height: 35px
176106
:width: 140px
177-
:target: https://www.capgemini.com/
107+
:target: https://www.capgemini.com/about-us/who-we-are/our-brands/capgemini-invent/
178108

179109
.. |Quantmetry| image:: https://www.quantmetry.com/wp-content/uploads/2020/08/08-Logo-quant-Texte-noir.svg
180110
:height: 35px
@@ -186,10 +116,10 @@ and with the financial support from Région Ile de France and Confiance.ai.
186116
:width: 45px
187117
:target: https://www.michelin.com/en/
188118

189-
.. |ENS| image:: https://www.ens.psl.eu/sites/default/files/logo_ens_psl_en_png.png
119+
.. |ENS| image:: https://ens-paris-saclay.fr/sites/default/files/ENSPS_UPSAY_logo_couleur_2.png
190120
:height: 35px
191121
:width: 140px
192-
:target: https://ens-paris-saclay.fr/en/
122+
:target: https://ens-paris-saclay.fr/en
193123

194124
.. |Confiance.ai| image:: https://pbs.twimg.com/profile_images/1443838558549258264/EvWlv1Vq_400x400.jpg
195125
:height: 45px
@@ -229,15 +159,13 @@ and with the financial support from Région Ile de France and Confiance.ai.
229159

230160
[12] Angelopoulos, Anastasios N., Stephen, Bates, Emmanuel J. Candès, et al. "Learn Then Test: Calibrating Predictive Algorithms to Achieve Risk Control." (2022).
231161

162+
Image credits:
163+
*Portrait: Cemrecan Yurtman / Zebra Horse Hybrid: hogrmahmood*
232164

233-
📝 License
234-
==========
235-
236-
MAPIE is free and open-source software licensed under the `license <https://github.com/scikit-learn-contrib/MAPIE/blob/master/LICENSE>`_.
237-
165+
📚 License & citation
166+
======================
238167

239-
📚 Citation
240-
===========
168+
MAPIE is free and open-source software licensed under the `BSD-3-Clause license <https://github.com/scikit-learn-contrib/MAPIE/blob/master/LICENSE>`_.
241169

242170
If you use MAPIE in your research, please cite the main paper:
243171

doc/images/educational_visual.png

449 KB
Loading

0 commit comments

Comments
 (0)
0