首页 > 解决方案 > 如何修复python中的“ValueError:找到样本数量不一致的输入变量:[395, 1]”错误

问题描述

我是 python 新手,我正在尝试学习机器学习。然后我遇到这种错误。我应该怎么办?

predict = "G3"

X = np.array(data.drop([predict], 1))
y = np.array([predict]) 
x_train, x_test, y_train, y_test = sklearn.model_selection.train_test_split(X, y, test_size = 0.1)

标签: pythonlinear-regression

解决方案


推荐阅读