-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
API prepare change of default solver QuantileRegressor #23637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API prepare change of default solver QuantileRegressor #23637
Conversation
…_quantile_transformer
When will scipy 1.6 be our minimal scipy version? |
https://scipy.org/news/#releases and in particular
From NEP29 which is a minimum requirement for scikit-learn:
scikit-learn 1.1.0 was released in 2022-05, so if we anticipate to release scikit-learn 1.2 in 2022-11, that means that we need to at least support 2022-11 - 24 == 2020-11 which includes SciPy 1.6 but not necessarily SciPy 1.5. |
But we can safely anticipate that for scikit-learn 1.4 the scipy dependency will be at least 1.6 (more likely 1.7). So I think we can directly change this PR to skip the "auto" option and warn that in scikit-learn 1.4 |
Works for me. I will update this PR. |
@@ -120,7 +126,7 @@ def test_quantile_estimates_calibration(q): | |||
quant = QuantileRegressor( | |||
quantile=q, | |||
alpha=0, | |||
solver_options={"lstsq": False}, | |||
solver="highs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests breaks on old scipy versions (<1.6.0) that we still support for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other tests to be updated similarly. We could probably have a help to chose the solver to use in the test based on the installed version of scipy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a small fixture to get the default value to use depending of the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM one comment on top of the one @lorentzenchr had.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Should update update the example examples/linear_model/plot_quantile_regression.py
to avoid raising the warning?
Since we need to run on the oldest supported scipy we might need to do the same ternary operation:
solver = "highs" if sp_version >= parse_version("1.6.0") else "interior-point"
in the example itself. But maybe we can just live with the warning. As you prefer.
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
I think this is nicer to not have the warning. I add the if/else condition with a short explanation for our reader advising to use |
…23637) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Related to #23626
"interior-point"
solver will be removed from SciPy 1.11.We need to introduce an
"auto"
mode to switch from one solver to another and announce a change of default.