【发布时间】:2020-06-26 11:22:50
【问题描述】:
我在运行代码时遇到错误。可能的错误是什么?
X = [['Item_Identifier', 'Item_Weight', 'Item_Fat_Content', 'Item_Visibility',
'Item_Type', 'Item_MRP', 'Outlet_Identifier',
'Outlet_Establishment_Year', 'Outlet_Size', 'Outlet_Location_Type',
'Outlet_Type']]
y = ['Item_Outlet_Sales']
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.80,test_size=0.20)
我得到的错误:
ValueError: With n_samples=1, test_size=0.2 and train_size=0.8, the resulting train set will be empty. Adjust any of the aforementioned parameters.
【问题讨论】:
-
X真的像这些还是熊猫数据框的这些列名???
标签: machine-learning scikit-learn train-test-split