Naive Bayes classifier

In Machine Learning, Naive Bayes is a supervised learning classifier.

Its popular in text categorization (spam or not spam) and even competes with advanced classifiers like support vector machines.

Naive Bayes classifier

In the example below we create the classifier, the training set,
then train the classifier using the training set and make a prediction.

The training set (X) simply consits of length, weight and shoe size. Y contains the associated labels (male or female).

Then we train the classifier with one line:

And finally make predictions with new data.

On the final part of the program we make a prediction with new data [190,70,43]. This then outputs the predicted value.

The phases are similar in all supervised learning classifiers:
supervised learning

If you predict for another set like [166, 65, 33],
you’ll get another predicted outcome.

As you may expect, it’s important to have a good training set for receiving good results.

Previous Post

Leave a Reply