Question

please provide detailed solution..

Page 4 of S Exercise 2. Weather Prediction Using Bayes Classifier 15 marks Imagine that you are given the following set of training examples. Training Data Play Tennis No Outlookk Temperature Humadity Wind Day 1 85 80 Day 4 Day 5 Day 6 Da Day 8 Day 9 Day 10 Day 11 Sun Sunn Overcast Rain Rain Rain Overcast Sunn Sun Rain Sunn Overcast Overcast Rain Weak Stron Weak Weak Weak Stron Stron Weak Weak Weak Stron Stron Weak Stron 68 65 80 65 95 72 60 75 75 Day 13 Day 14 81 No Assume that you have been given the following test data Test data Wind Weak Stron Strom Weak Stron Tennis Outlook Rain Ovecast Sun Overcast Rain Temperature Humidit 68 85 Yes 80 Tasks a) b) c) Discuss and comment on the results Classify the above test data using the Bayes Classifier model. each test case separately Develop a confusion matrix and calculate the accuracy and error rate of the NB classifier Show the calculations for

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Sine we have 4 attributes we need to find probability of the game tennis played based on each attribute. So for aech attribute a table is to be constructed. Also from the data there are 5 cases where game can't be played and 9 cases where the game can be played.

OUTLOOK

Play=Yes

Play=No

Total

Sunny

2/9

3/5

5/14

Overcast

4/9

0/5

4/14

Rain

3/9

2/5

5/14

Since temperature is numeric values we need to deiscretize it as High,Medium,Low such that

temp 60-70 low

temp 70-80 medium

temp 80-90 high

TEMPERATURE

Play=Yes

Play=No

Total

Low

3/9

1/5

4/14

Medium

4/9

2/5

6/14

High

2/9

2/5

4/14

The same thing nedd to do in th case of humidity

humidity 60-70 Low4/

humdity 70-80 Medium

humidity 80 above High

HUMIDITY

Play=Yes

Play=No

Total

Low

1/9

0/5

1/14

Medium

4/9

1/5

5/14

High

4/9

4/5

8/14

WIND

Play=Yes

Play=No

Total

Weak

6/9

2/5

8/14

Strong

3/9

3/5

6/14

Also P(Play=Yes)=9/14 and P(play=No)=5/14

Now we have gathered all information for the calssifier.In the next step we can test it using test cases

1. X = (Outlook=Rain, Temperature=Low, Humidity=High, Wind=Weak)

from the table

  • P(Outlook=Rain| Play=Yes) = 3/9
  • P(Temperature=Low | Play=Yes) = 3/9
  • P(Humidity=High | Play=Yes) = 4/9
  • P(Wind=Weak| Play=Yes) = 6/9
  • P(Play=Yes) = 9/14

Next we consider the fact that we cannot play a game:

  • P(Outlook=Rain| Play=No) = 2/5
  • P(Temperature=Low | Play=No) = 1/5
  • P(Humidity=High | Play=No) = 4/5
  • P(Wind=Weak| Play=No) = 2/5
  • P(Play=No) = 5/14

P(X|Play=Yes)P(Play=Yes) =(3/9) * (3/9) * (4/9) * (6/9) * (9/14) = 0.0211

P(X|Play=No)P(Play=No) = (2/5) * (1/5) * (4/5) * (2/5) * (5/14) = 0.0091

Finally, we have to divide both results by the evidence

  • P(X) = P(Outlook=Rain) * P(Temperature=Low) * P(Humidity=High) * P(Wind=Weak)
  • P(X) = 5/14*4/14*8/14*8/14=0.033

Then, dividing the results by this value

§ P(Play=Yes | X) = 0.0211/0.033 = 0.6393

§ P(Play=No | X) = 0.0091/0.033= 0.2757

Since Play=Yes has the highest value we can play tennis in this case

Add a comment
Know the answer?
Add Answer to:
please provide detailed solution.. Page 4 of S Exercise 2. Weather Prediction Using Bayes Classifier 15...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For the tennis data in (above): Suppose that every outlook=sunny had been always associated with play=...

    For the tennis data in (above): Suppose that every outlook=sunny had been always associated with play= no (i.e. outlook=sunny had never occurred together with play=yes). With this new training set (Below), predict the class of the following new example using Naïve Bayes classification outlook humidity windy play temperature 85 85 false sunny no 80 90 sunny true no 83 overcast 86 false yes rainy 70 false 96 yes rainy 68 false 80 yes rainy 65 70 true no 64 65...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT