Python 3.6
实现多项式线性回归源代码如下,在自己的环境中运行出现错误:
ValueError: Expected 2D array, got 1D array instead:
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.
解决如下:
因为datapoint为列表,是一维的