Naive Bayesian classification algorithm: An understanding of Bayesian formulae

Source: Internet
Author: User

In order to complete his graduation thesis, have to contact this naive Bayesian classification algorithm ... I'm so ashamed (I'm going to graduate and learn this ...) also first knowledge)

Haha, but it's never too late to learn.

To fully understand this algorithm, you must first go to Baidu

Originally naive Bayes classification algorithm is borrowed to Bayes theorem, then what is Bayes theorem ... Not many BB,

Let's take a look at what the conditional probability is: P (a| b) =p (AB)/p (b)

where P (a| b) refers to the probability of a occurring in cases where B has occurred. And this probability is the probability that A and b occur at the same time divided by B. The solution??? This is the first time I've seen this formula react.

When I finish this picture, I can almost understand that the intersection of a with B is equivalent to the probability that A and b occur simultaneously, i.e. P (AB)

http://blog.csdn.net/csfreebird/article/details/25009545 look at this guy, I'm not going to copy and paste it.

Take a look at the Bayesian formula: P (a│b) = (P (b| A) P (a))/(P (B))

Of course this can be deduced from the formula of conditional probability, as long as the original conditional probability formula P (a| b) P (AB) in =p (AB)/p (b) replaced by P (b| A) P (a) is our "cute" Bayesian formula.

I look at this formula, it seems that it is not so easy to understand: b occurrence of the probability of a occurs equal to the probability of the occurrence of a b multiplied by a probability of occurrence divided by B probability, what ghost ...

Of course, I went to Baidu again.

https://www.zhihu.com/question/19725590/answer/32177811#, this is pretty good.

My own understanding of the Bayesian formula:

The probability of a event being unconditional is P (a), and when the B event occurs, it changes the probability that a event occurs (that is, p (a) becomes P (a| B)).

So why does the occurrence of B affect the probability that a event will occur? What kind of connection is there between A and B?

The amount ... It seems that the relationship between A and B is actually because of their intrinsic reasons, as men like to play and women like to go shopping.

But this connection is measured, can be expressed in numbers, this measure is B after the occurrence of a can affect the intensity of a, hmm ... Further detail is the size ( influence ) of the impact on the occurrence of a after B occurs. And this metric is P (b| A) (likelihood ratio)

---------------------------------------------------raise a chestnut (copy and paste directly ...) ):----------------------------------------------------------

A machine in good condition to produce qualified product probability is 90%, in the fault status of the production of qualified product probability is 30%, the probability of a good machine is 75%, if one day the first product is qualified products, then the probability of the machine good today is how much.

In this example, P (A) is the probability that the machine is good, and P (B) is the probability that the first product is qualified.

So what I'm saying above is that a measure of the impact of B on a can be interpreted as the influence of the probability that the "first product is a qualifying item" on the "Machine Good" event is equal to P (b| A) =90%. Single from the visual figure of the impact or relatively large.

What is the probability of a occurring after B influence: P (a| B) =?

Wait, let's see what the probability of B is. P (product qualified) =p (good machine) *p (good product rate) +p (machine failure) *p (product qualification rate of machine failure) =0.75*0.9+0.25*0.3=0.75

P (A) turns out to be equal to 75% if the formula is directly set: The effect of event B gets the ' new probability ' P (a| B) =b influence on a *a unconditional probability/b unconditional probability =0.9

I feel like I'm touching the road.

Obviously, if B has less influence on a, then the probability of a occurring after B affects will also be smaller. So this understanding should be no problem.

Let's go ahead and continue with a yarn ... The idea is stuck, so let's change the idea:

If the Bayesian formula looks like this, the probability of a after B effect: P (a| B) = (P (b| A)/P (B)) *p (a)

Because P (b| A) in the final analysis or the probability of event B, just add a condition,

And under a certain condition B's probability of occurrence divided by B unconditional probability of occurrence (P (b| A)/P (B)), which can be understood as P (b| A) percentage in P (B). So this part (P (b| A)/P (B)) can be understood as a guideline and correction to P (a), so it is multiplied by P (a)

In combination with the example, B can occur in two different states, the first State is a (that is, the machine is good), the second state is ~a (i.e. machine failure), so we use P (b| A)/P (B) to instruct, amend P (a) to obtain P (a| B

If we want P (~a| b), use P (b|~a)/p (b) to guide and correct P (~a)

If according to this idea, where P (b|~a) =0.3,p (B) =0.75,p (~a) = 0.25,

So P (~a| b) =p (B|~a)/p (b) *p (~a) =0.3/0.75*0.25=0.1 (this seems to apply directly to the formula ....) )

Well... It's OK for me to understand that.

Naive Bayesian classification algorithm: An understanding of Bayesian formulae

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.