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()
Your testing data should have the same structure as your training data, modifying your testing
will get rid of the warning.