isotonic regression weird behavior?
Was trying to fit isotonic regression with non-trivial y_min and y_max: In [*17*]: X Out[*17*]: array([ 1.26336413, 1.31853693, -0.57200917, 0.3072928 , -0.70686507, -0.17614937, -1.59943059, 1.05908504, 1.3958263 , 1.90580318, 0.20992272, 0.02836316, -0.08092235, 0.44438247, 0.01791253, -0.3771914 , -0.89577538, -0.37726249, -1.32687569, 0.18013201]) In [*18*]: iso.isotonic_regression(X, y_min=0, y_max=0.1) Out[*18*]: array([-0.00826919, -0.00826919, -0.00826919, -0.00826919, -0.00826919, -0.00826919, -0.00826919, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344]) The solution does not satisfy the bounds that each entry should be in [0,0.1] -- Jonathan Taylor Dept. of Statistics Sequoia Hall, 137 390 Serra Mall Stanford, CA 94305 Tel: 650.723.9230 Fax: 650.725.8977 Web: http://www-stat.stanford.edu/~jtaylo
Should have included: In [*22*]: iso Out[*22*]: <module 'sklearn.isotonic' from '/Users/jonathantaylor/anaconda/envs/py27/lib/python2.7/site-packages/sklearn/isotonic.pyc'> On Tue, Jun 21, 2016 at 7:18 PM, Jonathan Taylor < jonathan.taylor@stanford.edu> wrote:
Was trying to fit isotonic regression with non-trivial y_min and y_max:
In [*17*]: X
Out[*17*]:
array([ 1.26336413, 1.31853693, -0.57200917, 0.3072928 , -0.70686507,
-0.17614937, -1.59943059, 1.05908504, 1.3958263 , 1.90580318,
0.20992272, 0.02836316, -0.08092235, 0.44438247, 0.01791253,
-0.3771914 , -0.89577538, -0.37726249, -1.32687569, 0.18013201])
In [*18*]: iso.isotonic_regression(X, y_min=0, y_max=0.1)
Out[*18*]:
array([-0.00826919, -0.00826919, -0.00826919, -0.00826919, -0.00826919,
-0.00826919, -0.00826919, 0.10449344, 0.10449344, 0.10449344,
0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344,
0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344])
The solution does not satisfy the bounds that each entry should be in [0,0.1]
-- Jonathan Taylor Dept. of Statistics Sequoia Hall, 137 390 Serra Mall Stanford, CA 94305 Tel: 650.723.9230 Fax: 650.725.8977 Web: http://www-stat.stanford.edu/~jtaylo
-- Jonathan Taylor Dept. of Statistics Sequoia Hall, 137 390 Serra Mall Stanford, CA 94305 Tel: 650.723.9230 Fax: 650.725.8977 Web: http://www-stat.stanford.edu/~jtaylo
Sorry, docstring is also a bit funny. Is the problem it is trying to solve have an __equality__ constraint for y_min, y_max or __inequality__ constraint for y_min / y_max? Either way the produced solution does not satisfy such a constraint... On Tue, Jun 21, 2016 at 7:19 PM, Jonathan Taylor < jonathan.taylor@stanford.edu> wrote:
Should have included:
In [*22*]: iso
Out[*22*]: <module 'sklearn.isotonic' from '/Users/jonathantaylor/anaconda/envs/py27/lib/python2.7/site-packages/sklearn/isotonic.pyc'>
On Tue, Jun 21, 2016 at 7:18 PM, Jonathan Taylor < jonathan.taylor@stanford.edu> wrote:
Was trying to fit isotonic regression with non-trivial y_min and y_max:
In [*17*]: X
Out[*17*]:
array([ 1.26336413, 1.31853693, -0.57200917, 0.3072928 , -0.70686507,
-0.17614937, -1.59943059, 1.05908504, 1.3958263 , 1.90580318,
0.20992272, 0.02836316, -0.08092235, 0.44438247, 0.01791253,
-0.3771914 , -0.89577538, -0.37726249, -1.32687569, 0.18013201])
In [*18*]: iso.isotonic_regression(X, y_min=0, y_max=0.1)
Out[*18*]:
array([-0.00826919, -0.00826919, -0.00826919, -0.00826919, -0.00826919,
-0.00826919, -0.00826919, 0.10449344, 0.10449344, 0.10449344,
0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344,
0.10449344, 0.10449344, 0.10449344, 0.10449344, 0.10449344])
The solution does not satisfy the bounds that each entry should be in [0,0.1]
-- Jonathan Taylor Dept. of Statistics Sequoia Hall, 137 390 Serra Mall Stanford, CA 94305 Tel: 650.723.9230 Fax: 650.725.8977 Web: http://www-stat.stanford.edu/~jtaylo
-- Jonathan Taylor Dept. of Statistics Sequoia Hall, 137 390 Serra Mall Stanford, CA 94305 Tel: 650.723.9230 Fax: 650.725.8977 Web: http://www-stat.stanford.edu/~jtaylo
-- Jonathan Taylor Dept. of Statistics Sequoia Hall, 137 390 Serra Mall Stanford, CA 94305 Tel: 650.723.9230 Fax: 650.725.8977 Web: http://www-stat.stanford.edu/~jtaylo
Looks like a bug indeed. Could you please put a small code snippet to enable us to reproduce.
I've submitted a ticket: https://github.com/scikit-learn/scikit-learn/issues/6921 with the small example Jonathan wrote up in the email. Cheers, N On 22 June 2016 at 00:27, Gael Varoquaux <gael.varoquaux@normalesup.org> wrote:
Looks like a bug indeed. Could you please put a small code snippet to enable us to reproduce.
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
A few quick thoughts: 1. What does the `isoreg` method in the `isotone` R library do with this data? We have seen multiple situations where differences between our implementation/behavior and the R implementation was not expected/communicated for users, so it would be good to know and potentially address here. 2. I'd like to draw our attention back to this PR's discussion: https://github.com/scikit-learn/scikit-learn/pull/4185 In particular, this comment distinguishing between a monotonic optimization of a specific sample* and a model fit from a training sample: https://github.com/scikit-learn/scikit-learn/pull/4185#issuecomment-72875303 For a long time, fit_transform() and fit() returned different results, and we have broken and unbroken this package for different use cases a few times over the last two years (e.g., `slinear` switch). Thanks, Michael J. Bommarito II, CEO Bommarito Consulting, LLC *Web:* http://www.bommaritollc.com *Mobile:* +1 (646) 450-3387 On Wed, Jun 22, 2016 at 11:55 AM, Nelle Varoquaux <nelle.varoquaux@gmail.com
wrote:
I've submitted a ticket: https://github.com/scikit-learn/scikit-learn/issues/6921 with the small example Jonathan wrote up in the email.
Cheers, N
On 22 June 2016 at 00:27, Gael Varoquaux <gael.varoquaux@normalesup.org> wrote:
Looks like a bug indeed. Could you please put a small code snippet to enable us to reproduce.
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
participants (4)
-
Gael Varoquaux -
Jonathan Taylor -
Michael Bommarito -
Nelle Varoquaux