Reshape your data either using array.reshape(-1, 1)

Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

版本原因  sklearn  0.19版本                0.18版本一维二维都可以

将代码里所有的一维数组   转化为二维数组就好 

通过.reshape(-1, 1)

(样本数,目标值)   

不知道有多少个样本     但每个样本只有一个目标值

(-1,1)

猜你喜欢

转载自blog.csdn.net/bc521bc/article/details/83475144