Skip to content

Commit

Permalink
DOC: Put all regression notebooks in the example section (and remove …
Browse files Browse the repository at this point in the history
…the notebooks_regression one). Mark them as pre-v1.
  • Loading branch information
Valentin-Laurent committed Jan 28, 2025
1 parent 6b2f8e3 commit b335a89
Show file tree
Hide file tree
Showing 27 changed files with 149 additions and 87 deletions.
5 changes: 1 addition & 4 deletions doc/index_regression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ Prediction intervals (regression)
:maxdepth: 2

choosing_the_right_algorithm_regression
examples_regression/4-tutorials/plot_main-tutorial-regression
examples_regression/4-tutorials/plot_cqr_tutorial
examples_regression/4-tutorials/plot_ts-tutorial
examples_regression/1-quickstart/plot_toy_model
examples_regression/index
notebooks_regression
theoretical_description_regression
theoretical_description_conformity_scores
18 changes: 0 additions & 18 deletions doc/notebooks_regression.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
===========================================================
Estimating prediction intervals of Gamma distributed target
===========================================================
==========================================================================================
[Pre-v1] Estimating prediction intervals of Gamma distributed target
==========================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
This example uses :class:`~mapie.regression.MapieRegressor` to estimate
prediction intervals associated with Gamma distributed target.
The limit of the absolute residual conformity score is illustrated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
====================================
Plotting CQR with symmetric argument
====================================
===================================================================
[Pre-v1] Plotting CQR with symmetric argument
===================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
An example plot of :class:`~mapie.quantile_regression.MapieQuantileRegressor`
illustrating the impact of the symmetry parameter.
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
============================================================
Estimate the prediction intervals of 1D heteroscedastic data
============================================================
===========================================================================================
[Pre-v1] Estimate the prediction intervals of 1D heteroscedastic data
===========================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
:class:`~mapie.regression.MapieRegressor` and
:class:`~mapie.quantile_regression.MapieQuantileRegressor` is used
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
==========================================================
Estimate the prediction intervals of 1D homoscedastic data
==========================================================
=========================================================================================
[Pre-v1] Estimate the prediction intervals of 1D homoscedastic data
=========================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
:class:`~mapie.regression.MapieRegressor` and
:class:`~mapie.quantile_regression.MapieQuantileRegressor`
Expand Down
8 changes: 5 additions & 3 deletions examples/regression/1-quickstart/plot_prefit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
===========================================================================
Example use of the prefit parameter with neural networks and LGBM Regressor
===========================================================================
==========================================================================================================
[Pre-v1] Example use of the prefit parameter with neural networks and LGBM Regressor
==========================================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
:class:`~mapie.regression.MapieRegressor` and
:class:`~mapie.quantile_regression.MapieQuantileRegressor`
Expand Down
9 changes: 6 additions & 3 deletions examples/regression/1-quickstart/plot_toy_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
======================================================
Plotting MAPIE prediction intervals with a toy dataset
======================================================
=====================================================================================
[Pre-v1] Plotting MAPIE prediction intervals with a toy dataset
=====================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
An example plot of :class:`~mapie.regression.MapieRegressor` used
in the Quickstart.
"""
Expand Down
2 changes: 2 additions & 0 deletions examples/regression/2-advanced-analysis/README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.. _regression_examples_2:

-----

2. Advanced analysis
--------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
================================================
Estimating coverage width based criterion
================================================
===============================================================================
[Pre-v1] Estimating coverage width based criterion
===============================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
This example uses :class:`~mapie.regression.MapieRegressor`,
:class:`~mapie.quantile_regression.MapieQuantileRegressor` and
:class:`~mapie.metrics` is used to estimate the coverage width
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
================================================
Estimating aleatoric and epistemic uncertainties
================================================
===============================================================================
[Pre-v1] Estimating aleatoric and epistemic uncertainties
===============================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
This example uses :class:`~mapie.regression.MapieRegressor` and
:class:`~mapie.quantile_regression.MapieQuantileRegressor` to estimate
prediction intervals capturing both aleatoric and epistemic uncertainties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
===============================
Estimating conditional coverage
===============================
==============================================================
[Pre-v1] Estimating conditional coverage
==============================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
This example uses :func:`~mapie.regression.MapieRegressor` with conformal
scores that returns adaptive intervals i.e.
(:class:`~mapie.conformity_scores.GammaConformityScore` and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
=================================================
Make Conformal Predictive Distribution with MAPIE
=================================================
================================================================================
[Pre-v1] Make Conformal Predictive Distribution with MAPIE
================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
"""

##############################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
================================================
Coverage Validity with MAPIE for Regression Task
================================================
===============================================================================
[Pre-v1] Coverage Validity with MAPIE for Regression Task
===============================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
This example verifies that conformal claims are valid in the MAPIE package
when using the CP prefit/split methods.
Expand Down
9 changes: 6 additions & 3 deletions examples/regression/2-advanced-analysis/plot_nested-cv.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
===========================================================
Nested cross-validation for estimating prediction intervals
===========================================================
==========================================================================================
[Pre-v1] Nested cross-validation for estimating prediction intervals
==========================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
This example compares non-nested and nested cross-validation strategies for
estimating prediction intervals with :class:`~mapie.regression.MapieRegressor`.
Expand Down
2 changes: 2 additions & 0 deletions examples/regression/3-scientific-articles/README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.. _regression_examples_3:

-----

3. Simulations from scientific articles
---------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
============================================================
Reproducing the simulations from Foygel-Barber et al. (2020)
============================================================
===========================================================================================
[Pre-v1] Reproducing the simulations from Foygel-Barber et al. (2020)
===========================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
:class:`~mapie.regression.MapieRegressor` is used to investigate
the coverage level and the prediction interval width as a function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
==================================================
Reproducing the simulations from Kim et al. (2020)
==================================================
=================================================================================
[Pre-v1] Reproducing the simulations from Kim et al. (2020)
=================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
:class:`~mapie.regression.MapieRegressor` is used to reproduce the simulations
by Kim et al. (2020) [1] in their article which introduces the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
======================================================================
Reproduction of part of the paper experiments of Zaffran et al. (2022)
======================================================================
=====================================================================================================
[Pre-v1] Reproduction of part of the paper experiments of Zaffran et al. (2022)
=====================================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
:class:`~mapie.regression.MapieTimeSeriesRegressor` is used to reproduce a
part of the paper experiments of Zaffran et al. (2022) in their article [1]
Expand Down
2 changes: 2 additions & 0 deletions examples/regression/4-tutorials/README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.. _regression_examples_4:

-----

4. Tutorials
------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
======================================
Tutorial for residual normalised score
======================================
=====================================================================
[Pre-v1] Tutorial for residual normalised score
=====================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
We will use the sklearn california housing dataset to understand how the
residual normalised score works and show the multiple ways of using it.
Expand Down
9 changes: 6 additions & 3 deletions examples/regression/4-tutorials/plot_cqr_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
====================================================
Tutorial for conformalized quantile regression (CQR)
====================================================
===================================================================================
[Pre-v1] Tutorial for conformalized quantile regression (CQR)
===================================================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
We will use the sklearn california housing dataset as the base for the
comparison of the different methods available on MAPIE. Two classes will
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
r"""
===============================
Tutorial for tabular regression
===============================
==============================================================
[Pre-v1] Tutorial for tabular regression
==============================================================
**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes.**
**This notebook hasn't been updated to the new API yet.**
In this tutorial, we compare the prediction intervals estimated by MAPIE on a
simple, one-dimensional, ground truth function ``f(x) = x * sin(x)``.
Expand Down
17 changes: 17 additions & 0 deletions examples/regression/5-other-notebooks/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _regression_examples_5:

-----

5. Other notebooks
--------------------------------------------

This section lists a series of Jupyter notebooks hosted on the MAPIE Github repository that can be run on Google Colab:

- `[Pre-v1] Estimating the uncertainties of homoscedastic and heteroscedastic noisy data for tabular regression <https://github.com/scikit-learn-contrib/MAPIE/blob/master/notebooks/regression/tutorial_regression.ipynb>`_


- `[Pre-v1] Estimating the uncertainties in the exoplanet masses <https://github.com/scikit-learn-contrib/MAPIE/tree/master/notebooks/regression/exoplanets.ipynb>`_


- `[Pre-v1] Estimating prediction intervals for time series forecast with EnbPI and ACI <https://github.com/scikit-learn-contrib/MAPIE/tree/master/notebooks/regression/ts-changepoint.ipynb>`_

6 changes: 5 additions & 1 deletion examples/regression/README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.. _regression_examples:

Regression examples
===================
===================

Following is a collection of notebooks demonstrating how to use MAPIE.

**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes. Not all notebooks have been updated to the new API yet. These are marked as `[Pre-v1]`.**
14 changes: 8 additions & 6 deletions notebooks/regression/exoplanets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
"cell_type": "markdown",
"id": "88266fe7-93bb-48c7-a84b-7a3ebe24c2c3",
"metadata": {},
"source": [
"# Estimating the uncertainties in the exoplanet masses"
]
"source": "# Estimating the uncertainties in the exoplanet masses"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes. This notebook hasn't been updated to the new API yet.**",
"id": "43970544651bd3bb"
},
{
"cell_type": "markdown",
"id": "66082f1a-7415-4392-973f-a267b23ec64b",
"metadata": {},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/scikit-learn-contrib/MAPIE/blob/master/notebooks/regression/exoplanets.ipynb)\n"
]
"source": "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/scikit-learn-contrib/MAPIE/blob/master/notebooks/regression/exoplanets.ipynb)\n"
},
{
"cell_type": "markdown",
Expand Down
12 changes: 8 additions & 4 deletions notebooks/regression/tutorial_regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"cell_type": "markdown",
"id": "a1d2af1c",
"metadata": {},
"source": [
"# Tutorial for regression"
]
"source": "# Tutorial for regression"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "**Note: we recently released MAPIE v1.0.0, which introduces breaking API changes. This notebook hasn't been updated to the new API yet.**",
"id": "1a0c1682ad61ba3e"
},
{
"cell_type": "markdown",
"id": "9a2e808e",
"metadata": {},
"source": [
"In this tutorial, we compare the prediction intervals estimated by MAPIE on a \n",
"In this tutorial, we compare the prediction intervals estimated by MAPIE on a\n",
"simple, one-dimensional, ground truth function\n",
"\n",
"$$\n",
Expand Down

0 comments on commit b335a89

Please sign in to comment.