From 3d61d5a7970eb18513544c351c7bc773d84006b8 Mon Sep 17 00:00:00 2001 From: Valentin Laurent Date: Wed, 15 Jan 2025 14:57:11 +0100 Subject: [PATCH] TEST: add sklearn check_estimator test for MapieRegressor (#600) --- HISTORY.rst | 1 + mapie/tests/test_regression.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 842bf269..1fe44eaa 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,7 @@ History * Documentation test: add a doc testing step (in MAKEFILE and CI) * Increase max line length from 79 to 88 characters * Bump wheel version +* Other minor evolutions 0.9.1 (2024-09-13) ------------------ diff --git a/mapie/tests/test_regression.py b/mapie/tests/test_regression.py index e2934bbf..1a7abc7c 100644 --- a/mapie/tests/test_regression.py +++ b/mapie/tests/test_regression.py @@ -20,6 +20,7 @@ ) from sklearn.pipeline import Pipeline, make_pipeline from sklearn.preprocessing import OneHotEncoder +from sklearn.utils.estimator_checks import check_estimator from sklearn.utils.validation import check_is_fitted from typing_extensions import TypedDict @@ -1039,3 +1040,8 @@ def test_deprecated_ensemble_regressor_fit_warning() -> None: match=r".WARNING: EnsembleRegressor.fit is deprecated.*" ): ens_reg.fit(X, y) + + +def test_mapie_regressor_sklearn_estim() -> None: + """Test that MapieRegressor is an sklearn estimator""" + check_estimator(MapieRegressor())