Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is naïve Bayes generative?

I am working on a document which should contain the key differences between using Naive Bayes (generative) and Logistic Regression (discriminative) models for text classification.

During my research, I ran into this definition for Naive Bayes model: https://nlp.stanford.edu/IR-book/html/htmledition/naive-bayes-text-classification-1.html

The probability of a document d being in class c is computed as ... where p(tk|c) is the conditional probability of term tk occurring in a document of class c...


When I got to the part of comparing Generative and Discriminative models, I found this explanation on StackOverflow as accepted: What is the difference between a Generative and Discriminative Algorithm?

A generative model learns the joint probability distribution p(x,y) and a discriminative model learns the conditional probability distribution p(y|x) - which you should read as "the probability of y given x".


At this point I got confused: Naive Bayes is a generative model and uses conditional probabilities, but at the same time the discriminative models were described as if they learned the conditional probabilities as opposed to the joint probabilities of the generative models.


Can someone shed some light on this please?

Thank you!

like image 994
GermanC Avatar asked Dec 27 '17 18:12

GermanC


People also ask

Is naive Bayes a generative algorithm?

Naive bayes is a Generative model whereas Logistic Regression is a Discriminative model . Generative model is based on the joint probability, p( x, y), of the inputs x and the label y, and make their predictions by using Bayes rules to calculate p(y | x), and then picking the most likely label y.

Why are generative models called generative?

A generative model is so called because it tries to learn the probability distribution that generated the data. For example, the Gaussian mixture model will try to learn the parameters of the Gaussian mixture that best fits the data.

Why is naive Bayes algorithm considered as generative model although it appears that it calculates conditional probability distribution?

It is generative in the sense that you don't directly model the posterior p(y|x) but rather you learn the model of the joint probability p(x,y) which can be also expressed as p(x|y) * p(y) (likelihood times prior) and then through the Bayes rule you seek to find the most probable y.

Is Bayesian network a generative model?

Bayesian Network or Bayes Network is a generative probabilistic graphical model that allows efficient and effective representation of the joint probability distribution over a set of random variables. Bayes Network consists of two main parts, which are structure and parameters.


1 Answers

It is generative in the sense that you don't directly model the posterior p(y|x) but rather you learn the model of the joint probability p(x,y) which can be also expressed as p(x|y) * p(y) (likelihood times prior) and then through the Bayes rule you seek to find the most probable y.

A good read I can recommend in this context is: "On Discriminative vs. Generative classifiers: A comparison of logistic regression and naive Bayes" (Ng & Jordan 2004)

like image 182
Kristianmitk Avatar answered Oct 02 '22 17:10

Kristianmitk