From 2e751c6580c8e92e09c31f4460fbbd2c6e2093a9 Mon Sep 17 00:00:00 2001 From: Edoardo Abati <29585319+EdAbati@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:49:03 +0200 Subject: [PATCH 1/2] fixed test for QuantileRegressor --- skops/io/tests/test_persist.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/skops/io/tests/test_persist.py b/skops/io/tests/test_persist.py index e8354f3d..222fb7bd 100644 --- a/skops/io/tests/test_persist.py +++ b/skops/io/tests/test_persist.py @@ -49,6 +49,7 @@ _enforce_estimator_tags_y, _get_check_estimator_ids, ) +from sklearn.utils.fixes import parse_version, sp_version import skops from skops.io import dump, dumps, get_untrusted_types, load, loads @@ -136,7 +137,16 @@ def _tested_estimators(type_filter=None): category=SkipTestWarning, message="Can't instantiate estimator", ) - estimator = _construct_instance(Estimator) + if name == "QuantileRegressor" and sp_version >= parse_version( + "1.11.0" + ): + # The solver "interior-point" (the default solver in + # scikit-learn < 1.4.0) is not available scipy >= 1.11.0. The + # default solver will be "highs" from scikit-learn >= 1.4.0. + # https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.QuantileRegressor.html + estimator = _construct_instance(partial(Estimator, solver="highs")) + else: + estimator = _construct_instance(Estimator) # with the kind of data we pass, it needs to be 1 for the few # estimators which have this. if "n_components" in estimator.get_params(): From 204117fb3e83ba5fe17e9f339b670d99b082004c Mon Sep 17 00:00:00 2001 From: Edoardo Abati <29585319+EdAbati@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:13:55 +0200 Subject: [PATCH 2/2] Update skops/io/tests/test_persist.py Co-authored-by: Benjamin Bossan --- skops/io/tests/test_persist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skops/io/tests/test_persist.py b/skops/io/tests/test_persist.py index 222fb7bd..eb69e70a 100644 --- a/skops/io/tests/test_persist.py +++ b/skops/io/tests/test_persist.py @@ -141,7 +141,7 @@ def _tested_estimators(type_filter=None): "1.11.0" ): # The solver "interior-point" (the default solver in - # scikit-learn < 1.4.0) is not available scipy >= 1.11.0. The + # scikit-learn < 1.4.0) is not available in scipy >= 1.11.0. The # default solver will be "highs" from scikit-learn >= 1.4.0. # https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.QuantileRegressor.html estimator = _construct_instance(partial(Estimator, solver="highs"))