我更新了scikit.learn,但我仍然收到此错误:ModuleNotFoundError:没有名为'sklearn.cross_validation'的模块



我想进行线性回归,我对scikit.learn有问题。我从20.1更新到20.2,但我仍然有ModulenotFoundError。

交叉验证功能已移至model_selection。要访问其功能,您可以尝试:

from sklearn.model_selection import cross_validate                                          
from sklearn.model_selection import cross_val_predict                          
from sklearn.model_selection import cross_val_score 
from sklearn.model_selection import train_test_split

参见交叉验证时的文档和示例

最新更新