用
x=[[6],[8],[10],[14],[18]]
y=[[7],[9],[13],[17.5],[18]]
是正确的,但是使用
x=[6,8,10,14,18]
y=[7,9,13,17.5,18]
就会报错
DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.
DeprecationWarning)
ValueError: Found input variables with inconsistent numbers of samples: [1, 5]
网址
http://www.jianshu.com/p/738f...
相关介绍没有看懂,惭愧。。。
http://scikit-learn.org/stabl...
Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1)
一周热门 更多>