documentation of constraints in `isotonic_regression`
See original GitHub issueThe docstring of isotonic_regression
says
https://github.com/scikit-learn/scikit-learn/blob/91badfab662ad1eafda4b60d078f563f010265cc/sklearn/isotonic.py#L84
Notice the equalities with respect to min and max.
However, the function does not actually force the smallest estimate to be y_min
and the largest to be y_max
. I believe that is the correct behavior; the estimates should be constrained, not fixed.
The docstring should therefore read
subject to y_min <= y_[1] <= y_[2] ... <= y_[n] <= y_max
If this is changed, https://github.com/scikit-learn/scikit-learn/blob/91badfab662ad1eafda4b60d078f563f010265cc/sklearn/isotonic.py#L147 should be changed as well.
What the function does is to apply np.clip
, i.e. first unconstrained estimates are produced and then everything outside of [y_min
, y_max
] is forced to these values.
https://github.com/scikit-learn/scikit-learn/blob/91badfab662ad1eafda4b60d078f563f010265cc/sklearn/isotonic.py#L135
I am not sure that is the correct approach for constrained quadratic optimization (but also don’t know positively it to be incorrect).
Tagging @bnaul and @agramfort since they seem to have introduced this line.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
This one was actually fixed in minus 5 days 😉
Taken care of in #16234 (your review is welcome there!)