This is a test version of Biostars. For the public version, visit https://www.biostars.org.
2020plus sklearn and cross_validation

Hi,

I have been trying to compile 2020plus, but continue to receive errors when running 2020plus.py.

python which 2020plus.py features \ -og-test oncogene.txt \ -tsg-test tsg.txt \ --summary summary_pancan.txt \ -o features_pancan.txt

Version: 1.2.3 Command: ~/2020plus-1.2.3/2020plus.py features -og-test oncogene.txt -tsg-test tsg.txt --summary summary_pancan.txt -o features_pancan.txt


AN ERROR HAS OCCURRED: check the log file


Type: <class 'importerror'=""> Exception: cannot import name 'cross_validation' from 'sklearn' (~/miniconda3/envs/2020plus/lib/python3.7/site-packages/sklearn/__init__.py) Traceback: File "~/2020plus-1.2.3/2020plus.py", line 263, in <module> import src.classify.python.classifier File "~/2020plus-1.2.3/src/classify/python/classifier.py", line 2, in <module> from src.classify.python.dummy_clf import DummyClf File "~/2020plus-1.2.3/src/classify/python/dummy_clf.py", line 2, in <module> from src.classify.python.generic_classifier import GenericClassifier File "~/2020plus-1.2.3/src/classify/python/generic_classifier.py", line 9, in <module> from sklearn import cross_validation

I understand that cross_validation is no longer supported by sklearn. Is there an update to 2020plus.py, a good work-around, or an earlier version of sklearn to download? Thank you!

2020plus cross_validation sklearn

1 answer

All modules that were in old sklearn's cross_validation are now in model_selection.

Can't quite make it out because the formatting is not clean, but in all the scripts where it says cross_validation it should be replaced with model_selection.

It seems that at least ~/2020plus-1.2.3/src/classify/python/generic_classifier.py is the candidate to do this.

Another option, which I would not recommend, is to downgrade your sklearn version to 0.19 or older.

Log in to answer this question.