1. 程式人生 > >Reshape your data either using array.reshape(-1, 1)

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)