[英]Module import error while importing train_test_split
I am trying to import the train_test_split
from sklearn
by using我正在尝试通过使用从sklearn
导入train_test_split
from sklearn.cross_validation import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
Every time I am getting the same error saying:每次我得到同样的错误说:
Module import error, module not found
I have tried creating a virtual environment in conda and also ran我尝试在 conda 中创建虚拟环境并运行
conda update -all康达更新-全部
I am still getting the same error.我仍然遇到同样的错误。
Replace代替
from sklearn.cross_validation import train_test_split
By经过
from sklearn.model_selection import train_test_split
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.