What is the difference between a generative and a
discriminative algorithm?
What is the difference between a generative and a discriminative algorithm?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let’s say you have input data
xand you want to classify the data into labelsy. A generative model learns the joint probability distributionp(x,y)and a discriminative model learns the conditional probability distributionp(y|x)– which you should read as “the probability ofygivenx“.Here’s a really simple example. Suppose you have the following data in the form
(x,y):(1,0), (1,0), (2,0), (2, 1)p(x,y)isp(y|x)isIf you take a few minutes to stare at those two matrices, you will understand the difference between the two probability distributions.
The distribution
p(y|x)is the natural distribution for classifying a given examplexinto a classy, which is why algorithms that model this directly are called discriminative algorithms. Generative algorithms modelp(x,y), which can be transformed intop(y|x)by applying Bayes rule and then used for classification. However, the distributionp(x,y)can also be used for other purposes. For example, you could usep(x,y)to generate likely(x,y)pairs.From the description above, you might be thinking that generative models are more generally useful and therefore better, but it’s not as simple as that. This paper is a very popular reference on the subject of discriminative vs. generative classifiers, but it’s pretty heavy going. The overall gist is that discriminative models generally outperform generative models in classification tasks.