I cannot import the cross_validation from sklearn library; I use sklearn version 0.20.0
from sklearn import cross_validation
later in the code:
features_train, features_test, labels_train, labels_test = cross_validation.train_test_split(word_data, authors, test_size=0.1, random_state=42)
Error:
Traceback (most recent call last):
File "D:meM.ScUdacity_ML_courseud120-projects- master
aive_bayes
b_author_id.py", line 16, in <module>
from email_preprocess import preprocess
File "../tools/email_preprocess.py", line 8, in <module>
from sklearn import cross_validation
ImportError: cannot import name cross_validation
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…