I know that passing 1d array is deprecated in Naive Bayes classifier, which I do not know why. However, For some reasons, once I built my model, I want to loop through a list of items and for each item I should call the naive classifier to predict the class. So, imagine my training set is X and my target class set is Y: And then I want to call the classifier for sample xx.
X = np.array([[1,0,1,1],[1,1,1,0],[0,0,0,1],[1,0,1,0])
Y = np.array([1,1,2,2])
from sklearn.naive_bayes import GaussianNB
clf = GaussianNB()
clf.fit(X, Y)
GaussianNB()
xx=[1,1,0,0]
clf.predict_proba(xx)
How can I fix my code so I get rid off this warning?