生成模型和判别模型直观理解

本文通过对比分析生成模型与判别模型的原理,以大象和狗的分类问题为例,阐述了生成模型侧重于建模每个类别的特性,而判别模型则寻找最佳决策边界。生成模型能生成数据,判别模型直接预测条件概率,后者通常在准确性上有优势。常见的生成模型包括朴素贝叶斯和隐马尔科夫模型,判别模型如感知机和决策树。
摘要由CSDN通过智能技术生成

1.最直观理解

吴恩达老师CS229课程笔记内容:
http://cs229.stanford.edu/notes/cs229-notes2.pdf

Consider a classification problem in which we want to learn to distinguish between elephants (y = 1) and dogs (y = 0), based on some features of an animal. Given a training set, an algorithm like logistic regression or the perceptron algorithm (basically) tries to find a straight line—that is, a decision boundary—that separates the elephants and dogs. Then, to classify a new animal as either an elephant or a dog, it checks on which side of the decision boundary it falls, and makes its prediction accordingly.
Here’s a different approach. First, looking at elephants, we can build a model of what elephants look like. Then, looking at dogs, we can build a separate model of what dogs look like. Finally, to classify a new animal, we can match the new animal against the elephant model, and match it against the dog model, to see whether the new animal looks more like the elephants or more like the dogs we had seen in the training set.

简而言之:
  为了区分大象和狗,判别式模型根据训练集找到决策边界生成式模型根据训练集分别对大象和狗建模,看测试样例更接近哪一个类别。这就是判别式(discrimitive model)和生成式模型(generative model)名称的由来(基于字面意思理解就对了)。显然,生成式模型在区分大象和狗的问题上,冗余较大,极有可能事倍功半。

在这里插入图片描述

Generative models can generate data.Discriminative models can discriminate data.
参见:https://www.zhihu.com/question/22374366/answer/155544744

2.对比一个经典例子

假设有4个samples:

sample1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值