python - 如何修复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)
解决方案
推荐阅读
- python - 我不知道如何根据蜂鸣器的条件编写开/关代码
- c - 如何为 C 项目编写简单的 makefile?
- php - laravel 7工匠密钥:生成不起作用
- javascript - 将倒计时下载按钮更改为文本显示按钮
- oracle-cloud-infrastructure - Oracle 实例无故停止
- c# - 当另一个网格单元格值更改时,一次更改 DataGridView 多个单元格值
- javascript - 如何使用 django 在 developertools 中的 cookie 中添加键和值?
- javascript - 如何在 Javascript 中使用倒数计时器创建随机文本生成器?
- javascript - 如何在打字稿中正确声明全局类型
- java - 电信运营商消息播放前如何处理