我想我的数据集分成训练和测试数据集,但我得到这个错误:模块“sklearn”有没有属性“cross_validation”
X_train,X_test,Y_train,Y_test = sklearn.cross_validation.train_test_split(X,df1['ENTRIESn_hourly'])
AttributeError Traceback (most recent call last)
<ipython-input-53-5445dab94861> in <module>()
----> 1 X_train,X_test,Y_train,Y_test = sklearn.cross_validation.train_test_split(X,df1['ENTRIESn_hourly'])
AttributeError: module 'sklearn' has no attribute 'cross_validation'
我该如何处理这个?
你是如何导入'sklearn'? 你试过[很多](https://stackoverflow.com/questions/16743889/cant-use-scikit-learn-attributeerror-module-object-has-no-attribute)[解决方案](https:// stackoverflow .com/questions/40496969/attributeerror-module-sklearn-metrics-has-no-attribute-calinski-harabaz-scor)在线找到? – Antimony