I ran this simple naive bayes program:
import numpy as np
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
Y = np.array([1, 1, 1, 2, 2, 2])
from sklearn.naive_bayes import GaussianNB
clf = GaussianNB()
clf.fit(X, Y)
print(clf.predict([[-0.8, -1],[-0.9, -1]]))
and the result I got is:
[1 1]
The [-0.8, -1]
is classified to 1, and the [-0.9, -1]
is classified to 2.
If I know my data all came from the same class, i.e., [[-0.8, -1],[-0.9, -1]]
came from the same class, is there a way for scikit-learn's naive bayes classifier to classify this data as a whole (and give me [1] as a result in this case), rather than classifying every data point individually.