天天看点

成功解决ValueError: Found input variables with inconsistent numbers of samples: [86, 891]

解决问题

ValueError: Found input variables with inconsistent numbers of samples: [86, 891]

解决思路

值错误:发现输入参数变量与样本数不一致:[86,891]。我们可以输出参数变量的形状查看,发现的确不一致,找到了问题的根源!

print(X.shape)

print(y.shape)

(86, 4)

(891,)

继续阅读