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
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.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.fixUpdate 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.fixIf 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.fixEnsure 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.fixVerify 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.