Bayesian filter algorithm

Source: Internet
Author: User

Naive Bayes classification is a very simple classification.AlgorithmIt is called Naive Bayes classification because the idea of this method is really simple. The basic idea of Naive Bayes is as follows: for the items to be classified, the maximum probability of occurrence of each category under the condition where this item appears is considered as the category of the item to be classified. In general, it is like this. You saw a black man in the street. I asked you where you guessed this guy. You guessed Africa in. Why? Because the ratio of black people to African people is the highest, of course, people may also be American or Asian people, but without other available information, we will select the category with the highest probability of condition, this is the basic idea of Naive Bayes, word http://zh.wikipedia.org/wiki/%E8%B4%9D%E5%8F%B6%E6%96%AF%E5% AE %9A%E7%90%86 on Wikipedia.

The formal definition of Naive Bayes classification is as follows:

1. Set it to a feature item to be classified, and each A is a feature attribute of X.

2. There is a set of classes.

3. computing.

4. If yes, then.

Now the key is how to calculate the probability of each condition in step 1. We can do this:

1. Find a set of items to be classified for a known classification. This set is called a training sample set.

2. Obtain the conditional probability estimation for each feature attribute under each category. That is.

3. If each feature attribute is conditional independent, the Bayesian theorem is derived as follows:

Because denominator is a constant for all classes, we only need to maximize the numerator. Because the feature attributes are independent of each other, they include:

According to the above analysis, the process of Naive Bayes classification can be represented (verification is not considered for the time being ):

We can see that the naive Bayes classification is divided into three phases:

The first stage is the preparation stage. The task at this stage is to make necessary preparations for Naive Bayes classification. The main task is to determine the feature attributes based on the actual situation and divide each feature attribute appropriately, then, some items to be classified are manually classified to form a training sample set. The input in this phase is all data to be classified, and the output is the feature attributes and training samples. This stage is the only stage that requires manual completion in the naive Bayes classification. Its quality will have an important impact on the entire process, the classifier quality is largely determined by the feature attributes, feature attribute division, and training sample quality.

The second stage is the Classifier Training phase. The task of this phase is to generate a classifier. The main task is to calculate the occurrence frequency of each category in the training sample and the conditional probability estimation of each feature attribute division for each category, and record the results. The input is the feature attribute and training sample, and the output is the classifier. This stage is a mechanical stage. According to the formula discussed aboveProgramThe calculation is completed automatically.

Stage 3: application stage. In this phase, a task uses a classifier to classify classified items. The input is the classifier and the item to be classified, and the output is the ing between the items to be classified and the category. This stage is also a mechanical stage, completed by the program.

 

Now we introduce an nbayes project, so it is easy to introduce statistics-based decision-making in applications.

 

Below are the collected articlesArticleIntroducing Bayesian algorithms:

Algorithm grocery stores-Naive Bayes classification of classification algorithms (naive Bayesian classification)

Bayesian inference and Internet applications (I)

Bayesian inference and its Internet applications (II)

Detailed Description: Application of Bayesian Algorithm in gcmail Anti-Spam system

How does the dead rational school determine whether beautiful girls are single?

Research on Network-oriented advertising algorithms [professional: Computer Application Technology]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.