[修复]没有模块命名‘sklearn.cross_validation’

在这篇文章中,我们将看到如何解决错误ModulenotFoundError:没有模块命名‘sklearn.cross_validation’ in Python.

问题:没有名为的模块‘sklearn.cross_validation’

You might get this error even through you have installed scikit-learn correctly on anaconda.

您可能会在Scneario以下收到此错误:

它可能会返回以下错误:

解决方案:用Model_Selection替换Cross_Validation

This error may be related to renaming and deprecation of Cross_Validation. sub-module to model_selection..

Cross_Validation. was deprecated in version 0.18 and was changed to model_selection. 从 version 0.20 onwards.

You should import model_selection. rather than Cross_Validation. as below:

您可以在此引用文件: //scikit-learn.org/stable/modules/cross_validation.html

It should resolve this issue. Please comment in case this solution does not resolve no module named sklearn.cross_validation issue.

那’s all about how to resolve no module named sklearn.cross_validation error in python.

相关文章

发表评论

您的电子邮件地址不会被公开。 必需的地方已做标记 *

订阅我们的纽特特斯特

为您的收件箱获取质量教程。现在订阅。