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.
我尝试过重塑,但是没有用。