【发布时间】:2015-08-29 01:15:32
【问题描述】:
只是试图做一个简单的线性回归,但我对这个错误感到困惑:
regr = LinearRegression()
regr.fit(df2.iloc[1:1000, 5].values, df2.iloc[1:1000, 2].values)
产生:
ValueError: Found arrays with inconsistent numbers of samples: [ 1 999]
这些选择必须具有相同的维度,并且它们应该是 numpy 数组,所以我缺少什么?
【问题讨论】:
-
我做了 reshape(-1,1) 并且成功了
标签: scikit-learn