LinAlgError:奇异矩阵逻辑回归

时间:2019-04-11 05:11:37

标签: python pandas dataframe scikit-learn logistic-regression

from sklearn.linear_model import LogisticRegression
logmodel = LogisticRegression()
logmodel.fit(y,X)
predictions = logmodel.predict(y)

我得到的错误:

ValueError: Expected 2D array, got 1D array instead:
array=[0. 0. 0. ... 1. 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.

我尝试过重塑,但是没有用。

0 个答案:

没有答案