Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

FutureWarning concerning default "rcond" value with numpy 1.16.1 #194

Open
MissingShoes opened this issue Mar 7, 2019 · 5 comments
Open

Comments

@MissingShoes
Copy link

MissingShoes commented Mar 7, 2019

When using pyearth with numpy 1.16.1, I get the following FutureWarinings:

python3.5/site-packages/pyearth/earth.py:802: FutureWarning: 'rcond' parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to pass 'rcond=None', to keep using the old, explicitly pass 'rcond=-1'.
and
pruning_passer.run() python3.5//site-packages/pyearth/earth.py:1055: FutureWarning: 'rcond' parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.

The second one is easy to fix by just passing rcond=-1 to np.linalg.lstsq in earth.py:1055 to keep using the old behaviour. But I do not know much about cython and was not able to fix the second one myself - even though I thought it might be simple.

Since I use Earth as base estimator in a gradient boosting implementation, it would be great to have less of these warnings issued.

@jcrudy
Copy link
Collaborator

jcrudy commented Mar 12, 2019

@MissingShoes These warnings are currently nothing to worry about. They are fixed in the v0.2dev branch. That branch is not yet ready to be released because of issues with scikit-learn compatibility, but you could use it if you're concerned about the warnings.

@MissingShoes
Copy link
Author

@jcrudy thanks for the info. I will use the dev branch instead.

@jcrudy
Copy link
Collaborator

jcrudy commented Mar 14, 2019

@MissingShoes Sounds good. As far as I can tell, the dev branch is currently fully functional except for some testing issues. I'd recommend you point any environment configuration files at the current commit rather than just the branch, since I'll be doing development on it and might break something later.

Also, I'm going to keep this issue open until these warnings are fixed in a release. Thanks for bringing it up!

@jcrudy jcrudy reopened this Mar 14, 2019
@jhsansom
Copy link

This obviously doesn't fix the root problem at hand, but one easy way to make the warnings go away would be to list this line right below your import statements:
import numpy as np
np.warnings.filterwarnings('ignore')

@RorisangSitoboli
Copy link

Change the line lstsq(A,b) to lstsq(A,b,rcond=None)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants