I'm using anaconda , when I import
import sklearn as sk
It works but when import :
from sklearn.cross_validation import train_test_split
It returns:
No module named 'sklearn.cross_validation'
I checked the environment and scikit-learn is installed what do I need to do?
As pointed out by @amit-gupta in the question above, sklearn.cross_validation
has been deprecated. The function train_test_split
can now be found here:
from sklearn.model_selection import train_test_split
Simply replace the import statement from the question to the one above.
simply replace sklearn.cross_validation with sklearn.model_selection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With