English 中文(简体)
Naive bayesian classifier - multiple decisions
原标题:

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.

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 .

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.

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.

最佳回答

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)

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]

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.

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. enter image description here

问题回答

A Bayes classifier should give a probability for an item to belong to each of several classes. It s definitely possible to have more than two classes.

With the probabilities for the classes, you will normally want to make a decision, which can be done by, e.g., choosing the most likely class. This may be why you re seeing it as providing just one possibility.





相关问题
List of proper names?

I m trying to filter names out of text blobs. Currently I m just generating a words list and filtering it by hand but I ve got ~8k words to go so I m looking for a better way. I could grab a ...

C#: Is there a way to classify enums?

Given the following enum: public enum Position { Quarterback, Runningback, DefensiveEnd, Linebacker }; Is it possible to classify the named constants, ...

How to let users specify multiple-level categories in Excel?

I m developing a kind of template with Excel 2007. Users will use it to create records which fall in 3-level categories. A user should be able to create a new category, specify an existing category or ...

Aggregating automatically-generated feature vectors

I ve got a classification system, which I will unfortunately need to be vague about for work reasons. Say we have 5 features to consider, it is basically a set of rules: A B C D E Result 1 2 b ...

Adaboost algorithm and its usage in face detection

I am trying to understand Adaboost algorithm but i have some troubles. After reading about Adaboost i realized that it is a classification algorithm(somehow like neural network). But i could not know ...

Ruby, why FeedNormalizer usage breaks Classifier::CRM114

Just learning Ruby and found something bizarre (at least for ansi-c programmer). Having Mac OS X 10.6.2, ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0], feed-normalizer 1.5.1 and crm114 ...

read url entered in a browser s address bar using JAVA

i want to write a java application that will classify url into malicious and benign. ie when the user types a url in the address bar, my program should read that url , classify it and block it if it ...

Question About Using Weka, the machine learning tool

I m using the explorer feature of Weka for classification. So I have my .arff file, with 2 features of NUMERIC value, and my class is a binary 0 or 1 (eg {0,1}). Sample: @RELATION summary @...

热门标签