Notes
Notes - notes.io |
RID age income student credit Ci
: buy
1 youth high no fair C2: no
2 youth high no excellent C2: no
3 middle-aged high no fair C1: yes
4 senior medium no fair C1: yes
5 senior low yes fair C1: yes
6 senior low yes excellent C2: no
7 middle-aged low yes excellent C1: yes
8 youth medium no fair C2: no
9 youth low yes fair C1: yes
10 senior medium yes fair C1: yes
11 youth medium yes excellent C1: yes
12 middle-aged medium no excellent C1: yes
13 middle-aged high yes fair C1: yes
14 senior medium no excellent C2: no
The data samples are described by attributes age, income, student,
and credit. The class label attribute, buy, tells whether the person
buys a computer, has two distinct values, yes (class C1) and no (class
Toc JJ II J I Back J Doc Doc I
Section 3: Example: Using the Naive Bayesian Classifier 10
C2).
The sample we wish to classify is
X = (age = youth, income = medium, student = yes, credit = fair)
We need to maximize P(X|Ci)P(Ci), for i = 1, 2. P(Ci), the a
priori probability of each class, can be estimated based on the training
samples:
P(buy = yes) = 9
14
P(buy = no) = 5
14
To compute P(X|Ci), for i = 1, 2, we compute the following conditional probabilities:
P(age = youth|buy = yes) = 2
9
P(age = youth|buy = no) = 3
5
P(income = medium|buy = yes) = 4
9
Toc JJ II J I Back J Doc Doc I
Section 3: Example: Using the Naive Bayesian Classifier 11
P(income = medium|buy = no) = 2
5
P(student = yes|buy = yes) = 6
9
P(student = yes|buy = no) = 1
5
P(credit = fair|buy = yes) = 6
9
P(credit = fair|buy = no) = 2
5
Using the above probabilities, we obtain
P(X|buy = yes) = P(age = youth|buy = yes)
P(income = medium|buy = yes)
P(student = yes|buy = yes)
P(credit = fair|buy = yes)
=
2
9
4
9
6
9
6
9
= 0.044.
Toc JJ II J I Back J Doc Doc I
Section 3: Example: Using the Naive Bayesian Classifier 12
Similarly,
P(X|buy = no) = 3
5
2
5
1
5
2
5
= 0.019
To find the class that maximizes P(X|Ci)P(Ci), we compute
P(X|buy = yes)P(buy = yes) = 0.028
P(X|buy = no)P(buy = no) = 0.007
Thus the naive Bayesian classifier predicts buy = yes for sample X.
easy to share with others. Click here ...
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team