Upload
nuncio
View
40
Download
1
Embed Size (px)
DESCRIPTION
Naive Bayes (DataSet). Naive Bayes (Disc-Naive-Bayes). Naive Bayes (Test). P(Class = yes | Outlook = sunny Temp = cool Humidity = high Windy = true). P(Class = no | Outlook = sunny Temp = cool Humidity = high Windy = true). Teorema de Bayes. Naive Bayes (Test). - PowerPoint PPT Presentation
Citation preview
Naive BayesNaive Bayes
(DataSet)(DataSet)
Outlook Temp Humidity Windy Class
sunny hot high false Don't Play
sunny hot high true Don't Play
overcast hot high false Play
rainy mild high false Play
rainy cool normal false Play
rainy cool normal true Don’t Play
overcast cool normal true Play
sunny mild high false Don’t Play
sunny cool normal false Play
rainy mild normal false Play
sunny mild normal true Play
overcast mild high true Play
overcast hot normal false Play
rainy mild high true Don’t Play
Naive BayesNaive Bayes
(Disc-Naive-Bayes)(Disc-Naive-Bayes)
Outlook temperature humidity windy play
yes no yes no yes no yes no yes no
sunny 2 3 hot 2 2 High 3 4 False 6 2 9 5
overcast 4 0 mild 4 2 normal 6 1 true 3 3
rainy 3 2 cool 3 1
sunny 2/9 3/5 hot 2/9 2/5 high 3/9 4/5 false 6/9 2/5 9/14 5/14
overcast 4/9 0/5 mild 4/9 2/5 normal 6/9 5/5 true 3/9 3/5
rainy 3/9 2/5 cool 3/9 1/5
Naive BayesNaive Bayes
(Test)(Test)
Outlook Temp Humidity Windy Class
sunny cool high true ??
• P(Class = yesyes | Outlook = sunny Temp = cool Humidity = high Windy = true)
• P(Class = nono | Outlook = sunny Temp = cool Humidity = high Windy = true)
)(
)()|()|(
EP
HPHEPEHP
Teorema de Bayes
Naive BayesNaive Bayes
(Test)(Test)
true)Windy high Humidity cool Tempsunny P(Outlook
0053,0
true)Windy high Humidity cool Tempsunny P(Outlook
true)Windy high Humidity cool Tempsunny P(Outlook
yes)P(Classyes) Class| trueP(Windy
yes)Class|high P(Humidityyes) Class | cool P(Tempyes) Class |sunny P(Outlook
true)Windy high Humidity cool Tempsunny P(Outlook
yes) P(Classyes) Class| trueWindy high Humidity cool Tempsunny P(Outlook
true)Windy high Humidity cool Tempsunny Outlook | yes P(Class
149
93
93
93
92
Naive BayesNaive Bayes
(Test)(Test)
true)Windy high Humidity cool Tempsunny P(Outlook
0206,0
true)Windy high Humidity cool Tempsunny P(Outlook
true)Windy high Humidity cool Tempsunny P(Outlook
)nP(Classno) Class| trueP(Windy
)nClass|high P(Humidityno) Class | cool P(Tempno) Class |sunny P(Outlook
true)Windy high Humidity cool Tempsunny P(Outlook
no) P(Classno) Class| trueWindy high Humidity cool Tempsunny P(Outlook
true)Windy high Humidity cool Tempsunny Outlook | no P(Class
145
53
54
51
53
o
o
true)Windy high Humidity cool Tempsunny P(Outlook
0053,0
true)Windy high Humidity cool Tempsunny Outlook | yes P(Class
Naive BayesNaive Bayes
(Test)(Test)
true)Windy high Humidity cool Tempsunny P(Outlook
0206,0
true)Windy high Humidity cool Tempsunny Outlook | no P(Class
Naive BayesNaive Bayes
(Test)(Test)
%5.200,0259
0053,0
)(
0206,00053,0 E)(P
0053,0
)(
0206,0
P(E)
0053,0 E)(P
0053,0
EPEP
Pyes
%5,79
)(
0206,0
P(E)
0053,0 E)(P
0206,0
EP
Pno
Naive BayesNaive Bayes
(DataSet)(DataSet)
Outlook Temp(ºF) Humidity Windy Class
sunny 85 85 false Don't Play
sunny 80 90 true Don't Play
overcast 83 86 false Play
rainy 70 96 false Play
rainy 68 80 false Play
rainy 65 70 true Don’t Play
overcast 64 65 true Play
sunny 72 95 false Don’t Play
sunny 69 70 false Play
rainy 75 80 false Play
sunny 75 70 true Play
overcast 72 90 true Play
overcast 81 75 false Play
rainy 71 91 true Don’t Play
Naive BayesNaive Bayes
(Naive-Bayes)(Naive-Bayes)
Outlook temperature humidity windy play
yes no yes no yes no yes no yes no
sunny 2 3 83 85 86 85 false 6 2 9 5
overcast 4 0 70 80 96 90 true 3 3
rainy 3 2 68 65 80 70
64 72 65 95
69 71 70 91
75 80
75 70
72 90
81 75
Outlook temperature humidity windy play
yes no yes no yes no yes no yes no
sunny 2/9 3/5 73 74,6 79,1 86,2 false 6/9 2/5 9/14 5/14
overcast 4/9 0/5 6,2 7,9 10,2 9,7 true 3/9 3/5
rainy 3/9 2/5
Naive BayesNaive Bayes
(Naive-Bayes)(Naive-Bayes)
Naive BayesNaive Bayes
(Test)(Test)
Outlook Temp Humidity Windy Class
sunny 66 90 true ??
• P(Class = yesyes | Outlook = sunny Temp = 66 Humidity = 90 Windy = true)
• P(Class = nono | Outlook = sunny Temp = 66 Humidity = 90 Windy = true)
2
2
2
)(
2
1)(
x
exfDistribución Normal
Naive BayesNaive Bayes
(Test)(Test)
0340,0)2,6(2
1)|66(
2
2
)2,6(2
))73((
x
eyesClassTempf
0221,0)|90( yesClassHumidityf
true)Windy high Humidity cool Tempsunny P(Outlook
000036,0
true)Windy 90 Humidity 66 Tempsunny P(Outlook
0221,00340,0 149
93
92
yesP
Naive BayesNaive Bayes
(Test)(Test)
%1,79
%9.20
no
yes
P
P
true)Windy high Humidity cool Tempsunny P(Outlook
000136,0
true)Windy 90 Humidity 66 Tempsunny P(Outlook
0380,00291,0 145
53
53
noP