Sir why the accuracy is so much high in this

in the mushroom problem ,the accuracy comes 99.565 with the hard coded of naive bayes classifier whereas using all the naive_bayes classifires like BinomailNB(), MultivariateNB() and GaussianNB() it comes maximum 84%, why this much diference sir?

hey @abubakar_nsit ,
It is because of the assumptions these algorithms make while training.
Simple Naive Bayes: It assumes that all the features are independent of each other ,which is in real world problems not even possible.

Bernoulli Naive Bayes : It assumes that all our features are binary such that they take only two discrete values.

Multinomial Naive Bayes : Its is used when we have discrete data (e.g. movie ratings ranging 1 and 5 as each rating will have certain frequency to represent).

Gaussian Naive Bayes : Because of the assumption of the normal distribution, Gaussian Naive Bayes is used in cases when all our features are continuous. For example in Iris dataset features are sepal width, petal width, sepal length, petal length. So its features can have different values in data set as width and length can vary.

Hence , Due to these different assumptions you are getting different scores on same dataset with different algorithm .

I hope this would have resolved your doubt .
Happy learning. :slight_smile: