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
ENH use Scipy isotonic_regression #28897
base: main
Are you sure you want to change the base?
Conversation
Within uncertainty, this shows no performance regression: This PR
MAIN
|
sklearn/isotonic.py
Outdated
y = np.array(y[order], dtype=y.dtype) | ||
sample_weight = _check_sample_weight(sample_weight, y, dtype=y.dtype, copy=True) | ||
sample_weight = np.ascontiguousarray(sample_weight[order]) | ||
if sp_version >= parse_version("1.12.0"): |
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.
Typically, we add this type of branching in utils.fixes
. Although, given the scope, I am okay with this approach.
Nit: It's a little bitter to compare base versions:
if sp_version >= parse_version("1.12.0"): | |
if sp_base_version >= parse_version("1.12.0"): |
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.
The CI failures look related to isotonic_regression
.
Reference Issues/PRs
Closes #27378.
What does this implement/fix? Explain your changes.
Use
scipy.optimize.isotonic_regression
as of scipy 1.12 instead of our own_inplace_contiguous_isotonic_regression
.Any other comments?