Gaussian-Nb-Simple

Sat 17 May 2025

title: "Gaussian NB Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


from sklearn import datasets
from sklearn.naive_bayes import GaussianNB
iris = datasets.load_iris()
gnb = GaussianNB()
y_pred = gnb.fit(iris.data, iris.target).predict(iris.data)
print("Number of mislabeled points out of a total %d points : %d" % (iris.data.shape[0],(iris.target != y_pred).sum()))
Number of mislabeled points out of a total 150 points : 6


Score: 5

Category: sklearn