scikit-learn-contrib / py-earth

A Python implementation of Jerome Friedman's Multivariate Adaptive Regression Splines
http://contrib.scikit-learn.org/py-earth/
BSD 3-Clause "New" or "Revised" License
455 stars 121 forks source link

Linear Algebra error with use_fast turned on #175

Closed Fish-Soup closed 6 years ago

Fish-Soup commented 6 years ago

Hi

I've had a piece of code running every day fitting multiple models and this error has never happened before. Essentially i am getting a linear algebra error *** LinAlgError: SVD did not converge in Linear Least Squares

when i call model.fit(x=xvar,Y=yvar,w=wvar)

if i call model.fit(x=xvar,Y=yvar) i dont get the error.

I am also using the use_fast =True, with fast_h=1. I notice when i set use_fast to False it doesn't crash.

Many thanks

jcrudy commented 6 years ago

@Fish-Soup Thanks for reporting this. Does it happen any time you use sample weights with use_fast=True and fast_h=1, or is it just for a particular data set? Is it possible to send the complete stack trace?

Fish-Soup commented 6 years ago

Hi sorry for late reply. unfortunately i cant reproduce the error now as the backing data has been updated now.

For context i have been running 24*8 models daily for half a year and this is the first time this error has happened so it must be something odd happening with the data. If i exclude the first data point it was fine, if i excluded the last data point it was also fine. Which i found odd.

again it only crashed with use_fast=True and fast_h=1, and using weights. if i turned weights of, use_fast off or dropped the first or last data point it worked. I suppose its pretty impossible for you to fix now as i cant get a full stack trace....

jcrudy commented 6 years ago

@Fish-Soup Yeah, there's not much I can do without a way to reproduce the problem. I suspect it happened during the pruning pass or linear fit and not the forward pass. Did you have the pruning pass enabled at the time? If it ever happens again and you're able to save the data set, I can attempt a fix. For now I'll close the issue.