From 93145938dbd3489d351e25596418570e5dff66f0 Mon Sep 17 00:00:00 2001 From: Valentin Laurent Date: Mon, 13 Jan 2025 11:27:09 +0100 Subject: [PATCH 1/2] REFACTOR: remove random_state from EnsembleRegressor (not used) --- mapie/estimator/regressor.py | 2 -- mapie/regression/regression.py | 1 - mapie/tests/test_common.py | 1 - mapie/tests/test_regression.py | 2 -- 4 files changed, 6 deletions(-) diff --git a/mapie/estimator/regressor.py b/mapie/estimator/regressor.py index ddf778e02..52c56f0e2 100644 --- a/mapie/estimator/regressor.py +++ b/mapie/estimator/regressor.py @@ -161,7 +161,6 @@ def __init__( cv: Optional[Union[int, str, BaseCrossValidator]], agg_function: Optional[str], n_jobs: Optional[int], - random_state: Optional[Union[int, np.random.RandomState]], test_size: Optional[Union[int, float]], verbose: int ): @@ -170,7 +169,6 @@ def __init__( self.cv = cv self.agg_function = agg_function self.n_jobs = n_jobs - self.random_state = random_state self.test_size = test_size self.verbose = verbose diff --git a/mapie/regression/regression.py b/mapie/regression/regression.py index f0191d4ab..bfca560f6 100644 --- a/mapie/regression/regression.py +++ b/mapie/regression/regression.py @@ -549,7 +549,6 @@ def init_fit( cv, agg_function, self.n_jobs, - self.random_state, self.test_size, self.verbose ) diff --git a/mapie/tests/test_common.py b/mapie/tests/test_common.py index 16a701c15..9e4901181 100644 --- a/mapie/tests/test_common.py +++ b/mapie/tests/test_common.py @@ -310,7 +310,6 @@ def test_warning_when_import_from_estimator(): cv=3, agg_function="mean", n_jobs=1, - random_state=0, test_size=0.2, verbose=0, ) diff --git a/mapie/tests/test_regression.py b/mapie/tests/test_regression.py index f06fff2e3..e2934bbf0 100644 --- a/mapie/tests/test_regression.py +++ b/mapie/tests/test_regression.py @@ -751,7 +751,6 @@ def test_aggregate_with_mask_with_invalid_agg_function() -> None: KFold(n_splits=5, random_state=None, shuffle=True), "nonsense", None, - random_state, 0.20, False ) @@ -1032,7 +1031,6 @@ def test_deprecated_ensemble_regressor_fit_warning() -> None: KFold(n_splits=5, random_state=None, shuffle=True), "nonsense", None, - random_state, 0.20, False ) From 3ae3be7ca82d8d3b39358781bf3b3c7683df84c7 Mon Sep 17 00:00:00 2001 From: Valentin Laurent Date: Mon, 13 Jan 2025 11:29:48 +0100 Subject: [PATCH 2/2] REFACTOR: remove random_state from EnsembleRegressor (not used) --- mapie/estimator/regressor.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mapie/estimator/regressor.py b/mapie/estimator/regressor.py index 52c56f0e2..3ec18bb16 100644 --- a/mapie/estimator/regressor.py +++ b/mapie/estimator/regressor.py @@ -125,12 +125,6 @@ class EnsembleRegressor: By default ``0``. - random_state: Optional[Union[int, RandomState]] - Pseudo random number generator state used for random sampling. - Pass an int for reproducible output across multiple function calls. - - By default ``None``. - Attributes ---------- single_estimator_: sklearn.RegressorMixin