scikit-learn-contrib / stability-selection

scikit-learn compatible implementation of stability selection.
BSD 3-Clause "New" or "Revised" License
209 stars 63 forks source link

In (stability selection.py) joblib externals are no longer part of scikit learn (descontinued) + In (randomized_lasso.py) sklearn.linear_model.base returns errors after executing clone and configuration when we call in some code this way (from stability_selection import RandomizedLasso) .####HOW TO SOLVE STEP BY STEP##### #38

Open 1993bio opened 2 years ago

1993bio commented 2 years ago

1 st.- Clone the project and run the commands as mentioned in the on main project page, but don't run setup.py yet.

2st- In windows go to the folder where the project was cloned. in my case this is the way: C:\Users\andre\stability-selection

3st- You will see two files named like this: randomized_lasso.py and stability_selection.py 3.1 - Open and edit them with IDLE python 3.2 - In randomized_lasso.py change it from sklearn.linear_model.base import _preprocess_data to from sklearn.linear_model._base import _preprocess_data 3.3 - In stability_selection.py change it from sklearn.externals.joblib import Parallel, delayed to import joblib as jb from joblib import Parallel, delayed

don't forget to ctrl+s to save file

4st- In cmd navigate to the folder where you made the clone as in step 2 above and run the command: python setup.py install

You will now be able to use stability selection in your codes, para new versions of in scikit learn and its dependencies

For those who already have the stability selection on their machine, they should delete any folder related to the package, even inside the python libs on the computer and start the above processes again.

For Linux users, the process is the same! with the exception of the cmd paths above.

                                                           Hope this helps people who have the same problem.
haitao19 commented 2 years ago

邮件已收到,会尽快查阅,谢谢!