Skip to content Skip to sidebar Skip to footer

Sklearn (bad Input Shape) Valueerror

I am new to the world of ML and sklearn. I tried to use GaussianNB on a dataset with X_train[2500,800], Y_train[2500,8]. from sklearn.naive_bayes import GaussianNB clf = GaussianN

Solution 1:

OP is using a one hot encoder so the fit function won't work with the array @Ishant Mrinal recommends this

Y_train = np.argmax(Y_train, axis=1)

That will allow you to pass the one hot encoding into the fit function.

Post a Comment for "Sklearn (bad Input Shape) Valueerror"