This is a scikit-learn error that I get when I do
my_estimator = LassoLarsCV(fit_intercept=False, normalize=False, positive=True, max_n_alphas=1e5)
Note that if I decrease max_n_alphas from 1e5 down to 1e4 I do not get this error any more.
Anyone has an idea on what's going on?
The error happens when I call
my_estimator.fit(x, y)
I have 40k
data points in 40
dimensions.
The full stack trace looks like this
File "/usr/lib64/python2.7/site-packages/sklearn/linear_model/least_angle.py", line 1113, in fit
axis=0)(all_alphas)
File "/usr/lib64/python2.7/site-packages/scipy/interpolate/polyint.py", line 79, in __call__
y = self._evaluate(x)
File "/usr/lib64/python2.7/site-packages/scipy/interpolate/interpolate.py", line 498, in _evaluate
out_of_bounds = self._check_bounds(x_new)
File "/usr/lib64/python2.7/site-packages/scipy/interpolate/interpolate.py", line 525, in _check_bounds
raise ValueError("A value in x_new is below the interpolation "
ValueError: A value in x_new is below the interpolation range.
from sklearn.linear_model import LassoLarsCV
followed by your line of code I get no error. please provide enough code to reproduce the error you are getting as well as the full traceback message. – Nenitanenneyx
values are monotonically increasing. Isx
monotonically increasing for your dataset? If they're not, try sorting the dataset withx
as the key and try again. If it works, let me know and I'll add a proper answer for the bounty :) – Olwenfit
as I'm guessingx
is a 40000 x 40 matrix? – Olweninterpolate.py
in thescipy
package, which does have those requirements. However, I'm not really minded to track it further if you won't put up data to reproduce and think it's a good idea to suggest that people offering free help are being ridiculous. – Olwen1e4
vs1e5
difference is interesting, but we need a dataset to replicate and therefore track down, it doesn't happen with all data (as the existing answer shows) – Olwen