朴素贝叶斯分类器-多个决策 [英] Naive bayesian classifier - multiple decisions

查看:151
本文介绍了朴素贝叶斯分类器-多个决策的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道朴素贝叶斯分类器 可用于生成多个决策.我不能 找到任何有证据支持的例子 多个决定.我是这个领域的新手.所以,我有点 糊涂了.

I need to know whether the Naive bayesian classifier can be used to generate multiple decisions. I couldn't find any examples which have any evidence in supporting multiple decisions. I'm new to this area. So, I'm bit confused.

实际上,我需要开发字符识别软件. 在那里,我需要确定给定字符是什么. 看来贝叶斯分类器可以用来识别 给定的字符是否是特定字符, 但它不能给出任何其他建议.

Actually I need to develop character recognition software. There I need to identify what the given character is. It seems the Bayesian classifier can be used to identify whether a character given is a particular character or not, but it cannot give any other suggestions.

例如,如果给出的图像为"3"(我们认为它为"3"), 如果系统无法将其标识为"3".如果看起来像 对于系统为"2",系统应返回"2".

For example, if an image of '3' is given(we think it's '3'), if the system cannot identify it as '3'. If it seems like '2' for the system, system should return '2'.

我对朴素贝叶斯分类器的想法 是,一旦我们训练了数据,我们可以问 系统是否给定字符是特定字符 或不.例如.我们画一个特定数字的图像并询问 系统是否为"2".

The idea that I have about Naive Bayesian classifier is, once we train data we can ask the system whether the given character is a particular character or not. Eg. We draw an image of a particular number and ask the system whether it's '2' or not.

我进一步注意到KNN(k最近邻居)给出了多个决定. 赋予它的字符,它决定了最接近的兼容字符 训练数据中给出的字符.

I further noticed KNN(k nearest neighbor) gives multiple decisions. A character given to that, it decides a nearest compatible character given in training data.

如果有人可以向我解释是否 朴素贝叶斯分类器可用于制作多个 诸如此类的决定.

It's highly appreciated if someone could explain me whether the Naive Bayesian classifier can be used to make multiple decisions such as above.

推荐答案

朴素贝叶斯分类器的假设是数据维是独立的(朴素部分),并且模型是生成性的(贝叶斯部分).换句话说,您可以建模如何从世界状态-P(data | world_state)生成数据,其中world_state可以是连续的,也可以是类别变量(具有多个类别类别).与歧视性模型相反,后者忽略数据生成并通过直接入侵"数据来描述世界状态的后验概率:P(world_state | data)

The assumption of a Naive Bayesian classifier is that data dimensions are independent (naive part) and that the model is generative (Bayesian part). In other words you model how data are generated from world states - P(data|world_state), where world_state can be continues or categorical variable (with multiple classes-categories). This runs in contrast to discriminative models that ignore data generation and describe a posterior probability of world states via 'hacking' the data directly: P(world_state|data)

以下是实现朴素贝叶斯分类器必须遵循的步骤:
1.使用生成模型(例如,高斯分布)对数据建模.每个类都有自己的高斯.在朴素的模型中,您对每个数据维度都采用高斯积.在更完整的模型中,高斯的维数等于数据的维数.
2.找出每个班级的先验条件(例如,为每个班级分配单一概率的分类分布);
3.通过使高斯适合您的数据来学习参数;
4.通过贝叶斯公式评估测试数据类:

Here are the steps you have to follow to implement a Naive Bayesian classifier:
1. Model your data with a generative model, for example, a Gaussian distribution. Each class would have its own Gaussian. In naive model you take product of Gaussians for each data dimension. In more complete model, the dimensionality of a Gaussian is equal to the dimensionality of the data.
2. Figure out a prior for each of your classes (for example, a categorical distribution with a single probability assigned to each class);
3. Learn parameters by fitting Gaussians to your data;
4. Evaluate test data class via a Bayesian formula:

P(class|data) = P(data|class) * P(class)/P(data);           [1]
P(data) = sum_over_classes[P(data|class) * P(class)];       [2]

公式1中的第一个术语称为后项,第二个是似然,最后一个是先验.当您计算后验(MAP)的最大值时,[2]中所示的分母通常会被忽略,后者是最有可能负责数据生成的类.但是,分母对于理解类模型如何协同工作非常重要.

The first term in formula 1 is called posterior, the second one is a likelihood and the last one is a prior. The denominator shown in [2] often gets ignored when you calculate a maximum of a posterior (MAP) that is the most probable class responsible for data generation. However, the denominator is very important in understanding how class models work together.

例如,您可以为每个类创建一个非常复杂的生成模型,但是由于在标准化过程中将一种可能性降低为0,因此后验看起来非常简单.在这种情况下,最好放弃贝叶斯方法并使用比生成模型中所包含的参数更少的参数来创建判别模型.在下图中,垂直轴表示世界状态(类)的概率,而水平轴表示数据.

For example, you can create a very sophisticated generative model for each class but your posterior would look very simple due to the fact that during normalization one of the likelihoods was reduced to 0. In this case it is better to abandon Bayesian approach and create a discriminative model with fewer parameters than you put in the generative one. In the diagram below, vertical axes are probabilities of a world state (class) while horizontal axes represent data.

这篇关于朴素贝叶斯分类器-多个决策的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆