Registry / ai-ml / mapie
library1.4.1pypypiunverified

MAPIE (Mapping Prediction Intervals) is a scikit-learn-compatible Python library for estimating prediction intervals. It provides tools for both regression and classification tasks, leveraging conformal prediction methods to quantify uncertainty. The current version is 1.3.0, and the library maintains an active release cadence with several major and minor updates per year.

pip install mapie
INSTALL
IMPORT
SIG · MAPIE
M
mapie
ai-mlpythonv1.4.1
Install
9.6s avg
Import
Disk
283MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 9.6s · import 0.000s · 272MB
283MB installed
● package 283MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MapieRegressor
from mapie.regression import MapieRegressor
from mapie.regression import MapieRegressor
MapieClassifier
from mapie.classification import MapieClassifier
MapieTimeSeriesRegressor
from mapie.time_series_regression import MapieTimeSeriesRegressor

This quickstart demonstrates how to use `MapieRegressor` to train a model and predict prediction intervals on synthetic regression data. It uses a `LinearRegression` model as the base estimator.

import numpy as np from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from sklearn.datasets import make_regression from mapie.regression import MapieRegressor # 1. Generate synthetic data X, y = make_regression(n_samples=500, n_features=1, noise=20, random_state=42) X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42 ) # 2. Fit a MAPIE regressor regressor = LinearRegression() mapie_regressor = MapieRegressor(regressor, cv="split", random_state=42) mapie_regressor.fit(X_train, y_train) # 3. Predict prediction intervals y_pred, y_pis = mapie_regressor.predict(X_test, alpha=0.1) # 4. Print results (example) print(f"Predicted value for first test sample: {y_pred[0]:.2f}") print(f"Prediction interval for first test sample: [{y_pis[0, 0, 0]:.2f}, {y_pis[0, 1, 0]:.2f}]")
Debug
Known issues
breakingThe v1.0.0 release introduced a major API rework, significantly changing import paths and the public API for classification and regression modules. Code written for versions prior to v1.0.0 will likely break.
fix
Update import statements (e.g., `from mapie.regression import MapieRegressor` instead of `from mapie import MapieRegressor`) and consult the v1.0.0 release notes and updated documentation.
affects: <1.0.0 to >=1.0.0
breakingThe risk control API in v1.2.0 changed how built-in risks are specified. Previously, users might have passed `BinaryClassificationRisk` objects, but now string representations are expected for built-in risks.
fix
If using risk control, update your code to pass risk names as strings (e.g., `risk_score_function="fdr"`) instead of `BinaryClassificationRisk` objects.
affects: <1.2.0 to >=1.2.0
gotchaMAPIE requires Python >=3.9. Attempting to install or run MAPIE on older Python versions will result in an error.
fix
Ensure your Python environment is version 3.9 or higher. Consider using `pyenv` or `conda` to manage Python versions.
affects: All versions
gotchaMAPIE has specific scikit-learn version requirements (currently >=1.0, <1.4). Using an incompatible scikit-learn version may lead to runtime errors or unexpected behavior.
fix
Verify your `scikit-learn` version with `pip show scikit-learn` and upgrade or downgrade if necessary using `pip install 'scikit-learn>=1.0,<1.4'` (adjusting bounds as per current MAPIE documentation).
affects: All versions
Upgrade
Version history
1.4.1latest on PyPI · released Jun 8, 2026
Audit
Dependencies
scikit-learnrequiredCore dependency for model training and compatibility, requires >=1.0, <1.4.
scipyrequiredNumerical routines, requires >=1.5.
numpyrequiredFundamental package for numerical computing, requires >=1.20.
Agent activity
12 hits · last 30 days
node
12
Resources
mapie — pip install mapie · libregistry