现在的位置: 首页 > 综合 > 正文

判别式模型与生成式模型

2017年12月12日 ⁄ 综合 ⁄ 共 3406字 ⁄ 字号 评论关闭

判别式模型与生成式模型

摘要 

  生成式模型:无穷样本
-> 概率密度模型 = 产生式模型 -> 预测

  判别式模型:有限样本
-> 判别函数 = 判别式模型 -> 预测

简介

  简单的说,假设
o 是观察值,m 是模型。

  如果对
P(o|m) 建模,就是生成式模型。其基本思想是首先建立样本的概率密度模型,再利用模型进行推理预测。要求已知样本无穷或尽可能的大限制。这种方法一般建立在统计力学和 Bayes 理论的基础之上。

  如果对条件概率
P(m|o) 建模,就是判别模型。
其基本思想有限样本条件下建立判别函数,不考虑样本的产生模型,直接研究预测模型。代表性理论为统计学习理论。

  这两种方法目前交叉较多。

判别式模型

  Discriminative
Model,又可以称为条件概率模型。估计的是条件概率分布,P(class|context),利用正负例和分类标签,关注在判别模型的边缘分布。更多用来直接解决给定的问题,而不侧重于建模。

  主要特点:

    寻找不同类别之间的最优分类面,反映的是异类数据之间的差异

  优点:

    分类边界更灵活,比使用纯概率方法或生产模型得到的更高级

    能清晰的分辨出多类或某一类与其他类之间的差异特征

    在聚类、viewpoint
changes, partial occlusion and scale variations中的效果较好

    适用于较多类别的识别

    判别模型的性能比生成模型要简单,比较容易学习

  缺点:

    不能反映训练数据本身的特性,能力有限,可以告诉你的是1还是2,但没办法把整个场景描述出来

    形式和结构上不如生成式模型优雅

    类似于黑盒,变量之间的关系不明确

  常见的主要有:

    Logistic
Regression

    SVM

    Traditional
Neural Networks

    Nearest
Neighbor

    CRF

    Linear
Discriminant Analysis

    Boosting

    Linear
Regression

生成式模型

  Generative
Model,又叫产生式模型。估计的是联合概率分布,P(class, context)=P(class|context)×P(context)。

  用于随机生成的观察值建模,特别是在给定某些隐藏参数情况下。在机器学习中,或用于直接对数据建模,或作为生成条件概率密度函数的中间步骤。通过使用贝叶斯规则可以从生成模型中得到条件分布。

  如果观察到的数据是完全由生成模型所生成的,那么就可以拟合生成模型的参数,从而尽可能的增加数据相似度。但数据很少能由生成模型完全得到,所以比较准确的方式是直接对条件密度函数建模,即使用分类或回归分析。

  主要特点:

    一般主要是对后验概率建模,从统计的角度表示数据的分布情况,能够反映同类数据本身的相似度

    只关注自己的
inclass 本身,不关心到底 decision boundary 在哪

  优点:

    实际上带的信息要比判别模型丰富,有更强的解释力

    研究单类问题比判别模型灵活性强

    模型可以通过增量学习得到

    能用于数据不完整的情况

  缺点:

    学习和计算过程比较复杂

  常见的主要有:

    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.

[参考网址]

  http://en.wikipedia.org/wiki/Generative_model

  http://en.wikipedia.org/wiki/Discriminative_model

  http://stackoverflow.com/questions/879432/what-is-the-difference-between-a-generative-and-discriminative-algorithm

  http://webdocs.cs.ualberta.ca/~chihoon/ml/slides/gvd.pdf

此条目由 lixiang 发表在 Research 分类目录,并贴了  标签。将固定链接加入收藏夹。

抱歉!评论已关闭.