Topic from Data Science.
Data mining is about discovering patterns or more general information in large data sets using methods from artificial intelligence, machine learning, statistics, and database systems.
A bayesian approach uses a probabilistic model including prior knowledge. Another assumption is that the naive approach assumes that the conditional probabilities are individual of each other.
Will this person buy a computer?
Age Income Student Credit rating Buys Computer ≤30 high no fair no ≤30 high no excellent no 31-40 high no fair yes >40 medium no fair yes >40 low yes fair yes >40 low yes excellent no 31-40 low yes excellent yes ≤30 medium no fair no ≤30 low yes fair yes >40 medium yes fair yes ≤30 medium yes excellent yes 31-40 medium no excellent yes 31-40 high yes fair yes >40 medium no excellent no ≤30 medium yes fair ??
- We have 14 people. At the bottom we know the characteristics, but not if they will buy a computer. We consider this table the training data. In this training data, only 9 people bought a computer, and we can divide them all into the 4 categories shown: age, income, student, credit rating
Age
| Age | Yes | No | Total |
|---|---|---|---|
| ≤30 | 2 | 3 | 5 |
| 31-40 | 4 | 0 | 4 |
| >40 | 3 | 2 | 5 |
| Total | 9 | 5 | 14 |
Income
| Income | Yes | No | Total |
|---|---|---|---|
| high | 2 | 2 | 4 |
| medium | 4 | 2 | 6 |
| low | 3 | 1 | 4 |
| Total | 9 | 5 | 14 |
Student
| Student | Yes | No | Total |
|---|---|---|---|
| No | 3 | 4 | 7 |
| Yes | 6 | 1 | 7 |
| Total | 9 | 5 | 14 |
Credit Rating
| Credit Rating | Yes | No | Total |
|---|---|---|---|
| fair | 6 | 2 | 8 |
| excellent | 3 | 3 | 6 |
| Total | 9 | 5 | 14 |
Recall Bayes’ Theorem:
So we have to compute:
- We know
- Applying the Naive Bayes approach, predictors are conditionally independent given the class:
- The denominator, i.e. the total probability of observing this combination of characteristics, is calculated using the law of total probability:
- Denominator equals to:
Thus: