当前位置:网站首页>【数据挖掘】生成模型和判别模型的区别及优缺点
【数据挖掘】生成模型和判别模型的区别及优缺点
2022-07-26 01:10:00 【Better Bench】

1 区别
(1)判别模型
学习P(x|y)。是用一个模型或函数直接拟合概率分布P(y|x),拟合P(x|y),是拟合从果到因的关系,即在Y发生的条件下,X发生的概率,对应实际训练中,是根据label来训练模型,再来判断类别,这种拟合出来的模型叫判别模型。
(2)生成模型
学习P(y|x)。公式拆解为三个部分 P ( y ∣ x ) = P ( x ∣ y ) P ( y ) P ( x ) P(y|x)=\frac{P(x|y)P(y)}{P(x)} P(y∣x)=P(x)P(x∣y)P(y)。
- P(x,y)是联合概率分布,是要拟合的东西,
- P(x)表示x的概率
- P(y)可通过样本的label直接求
则生成模型的过程解释为先拟合一个概率分布(本质是拟合P(x|y),因为P(x,y)=P(x|y)P(y)),再根据概率分布中最大的值,来判断数据的类型。拟合P(y|x),是拟合从因到果的关系,这种拟合出来的模型叫生成模型。说白了就是,生成模型根据联合概率分布可以采样生成数据。
注释:P ( x | y ):表示在Y发生的条件下,X发生的概率。P ( x , y ):是联合概率分布。P(x,y)=P(X=x and Y=y),就是同时对于X和Y的概率分布.
总结:直接拟合P (x|y)的是判别模型。直接拟合概念分布P(y,x),或者说间接拟合P(y|x)的是生成模型。
2 举例
(1)常见的判别模型
- K近邻(KNN)
- 线性回归(Linear Regression)
- 逻辑斯蒂回归(Logistic Regression)
- 神经网络(NN)
- 支持向量机(SVM)
- 高斯过程(Gaussian Process)
- 条件随机场(CRF)
- 分类回归树CART(Classification and Regression Tree)
(2)常见的生成模型
- LDA主题模型
- 朴素贝叶斯
- 混合高斯模型
- 隐马尔科夫模型(HMM)!
- 贝叶斯网络
- Sigmoid Belief Networks
- 马尔科夫随机场(Markov Random Fields)
- 深度信念网络(DBN)
3 优缺点
(1)生成模型
优点:
- 生成给出的是联合分布,不仅能够由联合分布计算条件概率分布,还可以给出其他信息,比如可以使用来计算边缘概率分布。如果一个输入样本的边缘分布很小的话,那么可以认为学习出的这个模型可能不太适合对这个样本进行分类,分类效果可能会不好,这也是所谓的outlier detection。
- 生成模型收敛速度比较快,即当样本数量较多时,生成模型能更快地收敛于真实模型。
- 生成模型能够解决存在隐变量的情况,比如混合高斯模型就是含有隐变量的生成方法。
缺点:
- 联合分布虽然能提供更多的信息,但也需要更多的样本和更多计算。当为了更准确估计类别条件分布,需要增加样本的数目,而且类别条件概率的许多信息是我们做分类用不到,因而如果我们只需要做分类任务,就浪费了计算资源。
- 实践中多数情况下,没有判别模型效果好。
(2)判别模型
优点:
- 节省计算资源,需要的样本数量也少于生成模型。
- 准确率往往较生成模型高。
- 由于直接学习,而不需要求解类别条件概率,所以允许我们对输入进行抽象(比如降维、构造等),从而能够简化学习问题。
缺点:
- 是没有生成模型的上述优点。
边栏推荐
- Web middleware log analysis script 3.0 (shell script)
- 《nlp入门+实战:第三章:梯度下降和反向传播 》
- Detailed explanation of at and crontab commands of RHCE and deployment of Chrony
- Force buckle 25. Turn over the linked list in a group of K
- [CTF] crypto preliminary basic outline
- 985高校副教授晒年薪,公积金顶普通人月薪,网友:不愧是在上海
- 【RTOS训练营】晚课学员问题
- Small sample learning data set
- Django database addition, deletion, modification and query
- NLP introduction + practice: Chapter 4: using pytorch to manually realize linear regression
猜你喜欢

Tencent employees' salary: the real 985 graduation salary, do you think I can be saved? Netizen: daily salary?

【RTOS训练营】站在更高的角度学习C语言

游戏思考17:寻路引擎recast和detour学习二:recast导航网格生成流程及局限性

985高校副教授晒年薪,公积金顶普通人月薪,网友:不愧是在上海

Game thinking 17: Road finding engine recast and detour learning II: recast navigation grid generation process and limitations

EasyCVR页面添加Loading加载效果的实现过程

What is informatization? What is digitalization? What are the connections and differences between the two?

Kubernetes Pod启动流程

【RTOS训练营】I2C和UART知识和预习安排 + 晚课提问

RHCE之at和crontab命令详解及chrony部署
随机推荐
Regular expression
Detailed explanation of rest assured interface testing framework
Nanjie's embarrassment
Docker高级篇-Mysql主从复制
中心对称的二进制模式CSLBP,matlab
如何mysql只要重复数据?
Paged query design of scenarios
如何才能修炼成一名不可替代的程序员?
If the native family is general, and the school is also a college on the rotten street, how to go on the next journey
El table scroll bar settings
The Chinese input (Pinyin input method) component created by lvgl official +100ask enables lvgl to support Chinese input!
ZK-Rollups工作原理
Unity get the animation being played
Force buckle 25. Turn over the linked list in a group of K
数据库系统原理与应用教程(057)—— MySQL 练习题
【软件开发规范四】《应用系统安全编码规范》
[secsha concept] large and small end
985 associate professors in Colleges and universities sun their annual salary, and the provident fund tops the monthly salary of ordinary people. Netizen: it is worthy of being in Shanghai
matlab 按位 与 或 非
Web middleware log analysis script 3.0 (shell script)