出现 No module named ‘sklearn.cross_validation’ 错误

原因:sklearn中已经废弃cross_validation,将其中的内容整合到model_selection
操作:cross_validation改成model_selection,比如将

from sklearn.cross_validation import KFold
from sklearn.cross_validation import cross_val_score

改为

from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_score

错误来源于 逻辑回归实战 入学接收问题

https://blog.csdn.net/qq_43653405/article/details/107655246

你可能感兴趣的:(bug,python,机器学习)