I am trying to import sklearn.model_selection
. I have tried to reinstall scikit-learn and anaconda, still not working.
Here is the error msg I got:
Check your scikit-learn version;
import sklearn
print(sklearn.__version__)
sklearn.model_selection
is available for version 0.18.1.
What you need to import depends on what you require. For instance, in version 0.18.1, GridSearchCV
can be imported as
from sklearn.model_selection import GridSearchCV
Whereas in version 0.17.1, the same can be imported as
from sklearn.grid_search import GridSearchCV
If you find anything in the new scikit documentation that doesn't work for you in your system, then search the document for the current version you are using. The import path might be different but the overall functionality ought to be the same.
If you don't have any previous projects or code that requires the older version, the better option would be to update your scikit-learn package. As you stated that you use Anaconda, the following post would be useful:
How to upgrade scikit-learn package in anaconda