# What are the main differences between a perceptron and a naive Bayes classifier?

What are the main differences between a perceptron and a naive Bayes classifier?

Naive Bayes is a generative algorithm while Perceptron is a discriminative algorithm. That is the main difference.

A perceptron is a linear threshold function. That means it has a weight vector $$w$$, and it outputs $$w \cdot x > t$$, where $$x$$ is the input vector and $$t$$ the threshold.

Naïve Bayes makes the assumption that all features are independent (hence the term naïve). It predicts the most likely class by using Bayesian probability, for each class multiplying the class prior with the the probability of the input given the class. The fact that we are modeling $$P(X|Y)$$ instead of $$P(Y|X)$$ makes it a generative model. Since we make the strong independence assumption, $$P(Y|X)$$ is modeled independently for each $$x_i \in X$$, usually via some sort of maximum likelihood estimation.