2
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis

clf = LinearDiscriminantAnalysis()
clf.fit(np.matrix(X_train), np.matrix(y_train))

but I get the error message. Specified above.

I checked the shape of y_train but it's (294,1). tried the ravel() thing but it then it's (1,294) and if I transpose it then it looks back how it did before the ravel().

X_train.shape is (294,8).

financial_physician
  • 1,672
  • 1
  • 14
  • 34

1 Answers1

3

first, don't use np.matrix, use np.array instead, its no longer recommended to use this class.

Try this:

clf.fit(X_train, np.ravel(y_train))