sklearn (Bad Input Shape) ValueError

后端 未结 1 1783
感情败类
感情败类 2021-01-21 15:04

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.         


        
相关标签:
1条回答
  • 2021-01-21 15:35

    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.

    0 讨论(0)
提交回复
热议问题