• 为了保证你在浏览本网站时有着更好的体验，建议使用类似Chrome、Firefox之类的浏览器~~
• 如果你喜欢本站的内容何不Ctrl+D收藏一下呢，与大家一起分享各种编程知识~
• 本网站研究机器学习、计算机视觉、模式识别~当然不局限于此，生命在于折腾，何不年轻时多折腾一下

# 判别式和生成式

3年前 (2017-03-10) 1514次浏览 扫描二维码

# 判别式模型与生成式模型的区别

Andrew Ng 在 NIPS2001 年有一篇专门比较判别模型和产生式模型的文章：
On Discrimitive vs. Generative classifiers: A comparision of logistic regression and naive Bayes

## 判别式模型常见的主要有：

Logistic Regression

SVM

Nearest Neighbor

CRF

Linear Discriminant Analysis

Boosting

Linear Regression

## 产生式模型常见的主要有：

Gaussians

Naive Bayes

Mixtures of Multinomials

Mixtures of Gaussians

Mixtures of Experts

HMMs

Sigmoidal Belief Networks, Bayesian Networks

Markov Random Fields

Latent Dirichlet Allocation

# 一个通俗易懂的解释

Let’s say you have input data x and you want to classify the data into labels y. 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’.

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) is

 y=0 y=1 x=1 1/2 0 x=2 1/4 1/4

p(y|x) is

 y=0 y=1 x=1 1 0 x=2 1/2 1/2

If 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 example x into a class y, which is why algorithms that model this directly are called discriminative algorithms. Generative algorithms model p(x,y), which can be tranformed into p(y|x) by applying Bayes rule and then used for classification. However, the distribution p(x,y) can also be used for other purposes. For example you could use p(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.

# 两个模型的对比

Deeplearn, 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明判别式和生成式 • 版权声明

本站的文章和资源来自互联网或者站长
的原创，按照 CC BY -NC -SA 3.0 CN
协议发布和共享，转载或引用本站文章
应遵循相同协议。如果有侵犯版权的资
源请尽快联系站长，我们会在24h内删
除有争议的资源。
• 网站驱动  粤ICP备17053707号-1
• 友情链接

• 支持主题

邮箱：service@deeplearn.me  