Skip to content Skip to sidebar Skip to footer

Python Sklearn.model_selection Giving Error Unable To Import Comb

I am importing train_test_split as: from sklearn.model_selection import train_test_split and it is giving an error cannot import name 'comb'. The versions I am using are scipy 0.1

Solution 1:

The suggestion in the comment above worked for me.

scikit-learn version 0.17.1 doesn't have the 'model-selection' module (it has instead the 'cross_validation' module, reference here). Since you have Anaconda installed, trying to upgrade scikit-learn to the newest version using the pip installer may cause a mismatch with the installed scipy and numpy versions (upgrading them with the pip installer wont solve the problem). The solution is to upgrade all three libraries using anaconda's installer, but before that all existing versions must be uninstalled, first using pip (in case, like me, you already went the pip route) then using conda.

Following the suggestions in the referred link:

pip uninstall:

pip uninstall numpy scipy -y
pip uninstall scikit-learn -y

conda uninstall:

conda uninstall numpy scipy scikit-learn -y

conda install:

conda install numpy scipy scikit-learn -y

Don't forget to restart Anaconda before retrying your import clause.

Post a Comment for "Python Sklearn.model_selection Giving Error Unable To Import Comb"