일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- Absolute
- AGI
- ai
- AI agents
- AI engineer
- AI researcher
- ajax
- algorithm
- Algorithms
- aliases
- Array 객체
- ASI
- bayes' theorem
- Bit
- Blur
- BOM
- bootstrap
- canva
- challenges
- ChatGPT
- Today
- In Total
A Joyful AI Research Journey🌳😊
Understanding Probability Normalization in Naive Bayes 본문
Understanding Probability Normalization in Naive Bayes
yjyuwisely 2023. 9. 9. 23:33In the context of the Naive Bayes classifier, probability normalization plays a vital role, especially when we want our probabilities to reflect the true likelihood of an event occurring in comparison to other events.
When predicting class labels using the Naive Bayes formula, we compute the product of feature probabilities for each class. However, these products do not sum up to 1 across classes, making them hard to interpret as probabilities. This is where normalization comes in.
Let's understand this with a basic example:
Suppose we have two classes, A and B, and we compute the product of feature probabilities for both:
P(features|A) = 1/2 and P(features|B) = 1/4.
To get the probability of a data point belonging to class A or B, we need to normalize:
Normalized P(A|features)
= P(features|A) / [P(features|A) + P(features|B)]
= 0.5 / (0.5 + 0.25)
= 2/3 or 0.67.
Similarly, for class B:
Normalized P(B|features)
= P(features|B) / [P(features|A) + P(features|B)]
= 0.25 / 0.75
= 1/3 or 0.33.
After normalization, the probabilities for the classes A and B will sum up to 1. This way, Naive Bayes ensures that our class predictions are probabilistically coherent.
'🌳AI Projects: NLP🍀✨ > NLP Deep Dive' 카테고리의 다른 글
Computing the Posterior Probability Using Bayes' Theorem (0) | 2023.09.11 |
---|---|
Processing Text Data for Bayesian Inference with Python (0) | 2023.09.11 |
Resolving the "NameError: name 'pd' is not defined" in Python (0) | 2023.09.11 |
The regex pattern \b\w+\b with examples (0) | 2023.09.09 |