Professional Documents
Culture Documents
Supervised Learning
(Naïve Bayes Algorithm)
September 27,
Dr. Hikmat Ullah Khan 1
2018
Supervised vs. Unsupervised Learning
Applications
Classification / Prediction
Detection /recognition
2
Supervised vs. Unsupervised Learning
3
Prediction Problems: Classification vs.
Numeric Prediction
Classification
predicts categorical class labels
4
Classification—A Two-Step Process
Model construction: describing a set of predetermined classes
Each tuple/sample is assumed to belong to a predefined class, as
mathematical formulae
Model usage: for classifying future or unknown objects
Estimate accuracy of the model
5
Process (1): Model Construction
Classification
Algorithms
Training
Data
Classifier
Testing
Data Unseen Data
September 27,
Dr. Hikmat Ullah Khan 10
2018
Towards Naïve Bayesian Classifier
O This can be derived from Bayes’ theorem
P(X | C )P(C )
P(C | X) i i
i P(X)
O Since P(X) is constant for all the classes, we have only
September 27,
Dr. Hikmat Ullah Khan 11
2018
Naïve Bayesian Classifier: Training Dataset
age income studentcredit_rating
buys_compute
Class: <=30 high no fair no
<=30 high no excellent no
C1:buys_computer = ‘yes’
31…40 high no fair yes
C2:buys_computer = ‘no’ >40 medium no fair yes
>40 low yes fair yes
Data sample >40 low yes excellent no
X = (age <=30, 31…40 low yes excellent yes
Income = medium, <=30 medium no fair no
<=30 low yes fair yes
Student = yes
>40 medium yes fair yes
Credit_rating = Fair) <=30 medium yes excellent yes
31…40 medium no excellent yes
31…40 high yes fair yes
>40 medium no excellent no
17
Exercise
September 27,
Dr. Hikmat Ullah Khan 2018
18
Task
O Given a new instance, predict its label
x’=(Outlook=Sunny, Temperature=Cool,
Humidity=High, Wind=Strong)
September 27,
Dr. Hikmat Ullah Khan 2018
19
September 27,
Dr. Hikmat Ullah Khan 2018
20