使用Scikit-Learn方法(train_test_split)创建训练/分割数据集时出错

时间:2016-05-02 20:34:50

标签: python-2.7 pandas scikit-learn

有人知道使用Scikit-Learn方法(train_test_split)创建训练/分割数据集时导致此错误的解释和解决方案:

# list of feature names
feature_cols = ['date_time', 'bow', 'steel', 'swing', 'nail', 'peg']

# a subset of the original DataFrame
X = data[feature_cols]

# select a Series from the DataFrame
y = 'marks'

# split into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y,random_state=1)

错误:

ValueError: Found arrays with inconsistent numbers of samples: [      3 7126674]

0 个答案:

没有答案