What is the difference between a Generative and Discriminative Algorithm?
来源:互联网 发布:餐饮库存软件 编辑:程序博客网 时间:2024/06/05 04:38
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 0x=2 | 1/4 1/4
p(y|x)
is
y=0 y=1 -----------x=1 | 1 0x=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://stackoverflow.com/questions/879432/what-is-the-difference-between-a-generative-and-discriminative-algorithm
- What is the difference between a Generative and Discriminative Algorithm?
- What is the difference between a parametric learning algorithm and a nonparametric learning method?
- What is the difference between a thread and a process?
- What is the difference between a definition and a declaration?
- What is the difference between a process and a thread?
- What is the difference between an EXE and a DLL?
- What is the difference between GenericServlet, HttpServlet and a Servlet?
- What is the difference between test, [ and [[ ?
- What is the difference between a = a * (2^3) and a = a << 3?
- What is the difference between a processor, a chip, a socket, and a core?
- What is the difference between a theorem, a lemma, and a corollary?
- What Is the Difference Between a Block, a Proc, and a Lambda in Ruby
- What is the difference between a URI, a URL and a URN
- What is the difference between a von Neumann architecture and a Harvard architecture?
- What is the difference between a pack slip and a pick slip?
- What is the difference between a Bayesian network and a Naive Bayes classifier?
- In SQL, what is the difference between a left join and a left outer join?
- What is the difference between a left outer join and a right outer join?
- 重装系统后右键菜单如何处理
- java中创建对象的方法
- C++中的类型转换
- Handler sendMessage 与 obtainMessage (sendToTarget)比较
- C++的显式类型转换
- What is the difference between a Generative and Discriminative Algorithm?
- allegro焊盘封装制作的一些注意事项
- HDU 4252
- 学习线程同步的总结
- Android应用添加(创建)和删除及判断是否存在桌面快捷方式
- Android build.prop生成过程
- 关于hashcode()和equal()方法的运用
- 修改UBOOT和LINUX调试串口(TI达芬奇芯片--DM6467)
- 我的第一篇博文