9. Given the following documents determine the weights for Naïve Bayesian category for document to be about “Trees”. Given the new document listed determine if it should be given the category or not. (14 points)

Doc1 Oak, Plum, rose, Oak, Oak, Plum, ash, ash, ash
Doc2 Plum strawberry, OAK, Ash, Ash, Ash, Oak, Ash
Doc3 Ash, Plum, Apple, Apple, Apple, Oak, Ash, Plum Doc4 Ash, Ash, rose, rose, plum, plum, plum, Oak
is member of trees is member of trees is member of trees is member of trees

To determine the weights for the Naïve Bayesian category for the document to be about "Trees", follow these steps:

1. Count the frequency of each word in the category "Trees" (i.e., all documents that are about trees):
- Tree: 4
- Oak: 4
- Plum: 4
- Ash: 6
- Rose: 2
- Apple: 1
- Strawberry: 0

2. Calculate the total count of words in the category "Trees":
Total words = 4 + 4 + 4 + 6 + 2 + 1 + 0 = 21

3. Calculate the weight for each word in the category "Trees":
- Tree: 4/21 ≈ 0.19
- Oak: 4/21 ≈ 0.19
- Plum: 4/21 ≈ 0.19
- Ash: 6/21 ≈ 0.29
- Rose: 2/21 ≈ 0.10
- Apple: 1/21 ≈ 0.05
- Strawberry: 0/21 = 0

Now that we have the weights for each word, let's determine if the new document should be given the category "Trees". The new document is as follows:

New Document: Oak, Plum, Rose, Oak, Oak, Plum, Ash, Ash, Ash

To determine if the new document belongs to the "Trees" category, we need to calculate the overall probability of the document belonging to the category using Naïve Bayesian classification:

P(Document | Trees) = P(Oak | Trees) * P(Plum | Trees) * P(Rose | Trees) * P(Oak | Trees) * P(Oak | Trees) * P(Plum | Trees) * P(Ash | Trees) * P(Ash | Trees) * P(Ash | Trees)

Multiply the weights for each word:

0.19 * 0.19 * 0.10 * 0.19 * 0.19 * 0.19 * 0.29 * 0.29 * 0.29 ≈ 0.001

The resulting probability is very low, indicating that the new document is unlikely to belong to the "Trees" category.