This article has participated in the activity of “New person creation Ceremony”, and started the road of digging gold creation together

Naive Bayes

Just learned simple bayesian come and share the mew: ahaha ha ha ha, people always feel the bayesian is a very magical theory, because compared to other probability, we seek first is our results of probability, and then based on the results of already know tell us the probability of events. It also introduces our prior probability, our posterior probability, our conditional probability. Let’s take a look at Wen Zouzou’s explanation.

Why is he called plain? It is not because all labels are independent of each other in his understanding and judgment, but let’s take a look at it with a little earthen

Small example

Let’s now give two features and a result, and analyze it concretely

What is the prior probability?

That is, if we look at the labeled probabilities of the outcome without looking at anything, we can see that there are only two possibilities here male: 1/2 female: 1/2 ok, congratulations, we already know the prior probabilities, which is to just take all the possible proportions of our outcome

What is a posterior probability?

And this is what I think is amazing, we assume that we know the result, and then we figure out the probability of the tag, which is one of the conditional probabilities

In the case that we already know the gender, the footprint ratio of their tags

High | p (boy) : 2/5 – – – p (high | girl) : 0/5

| in the p (boy) : 2/5 – – – p | in (girl) : 4/5

P (low | boy) : 1/5 – – – p (low | girl) : 1/5

Heavy | p (boy) : 3/5 – – – p (heavy) | girl: 2/5

Light | p (boy) : 2/5 – – – p (light | girl) : 3/5

Notice that our denominator here is just the sum of our current results

application

Now LET me tell you weight: heavy Height: medium sex:?? Ok, so now we can use our naive Bayes, and this is actually a total probability formula

Didn’t we just figure out all the conditional probabilities

: we should see if it’s a boy’s probability p (heavy | boy) : 3/5 times p | in (boy) : 2/5

We take a look at if is girl’s probability p (heavy) | girl: 2/5 times p | in (girl) : 4/5

The product set of these guys is the numerator of the formula

In the case of boys, the numerator is 6/25

And in the case of girls, the numerator is 8/25

Our denominator is the total probability formula, which means that our denominator is the same and so in this case, the one with the largest numerator is going to have a higher probability, and obviously we’re going to judge it to be a girl in this case

application

Hey hey, semantic recognition towards us, distinguish the junk mail, because of this, we can go to get a single tag inside of frequency, we have the result, the number of such returned to our naive bayes, when such as if we learn more deeply, also learned that the continuous random variables, and our smooth curve, If you are interested, you can go to know about it. Xiao Tang has given us all a start.