Professional Documents
Culture Documents
studies- Al-Aflaj
Department of
computer Science
1
Classification
Classification could be binary or multi classification:
Binary Classification
Multi Classification
Example: Image classification
input desired
output
apple
pear
tomato
cow
dog
horse
Object Recognition for Automotive Vehicles
6
Example: Training and testing
y = f(x)
output
classification input
function
◼ Learning: given a training set of labeled examples
{(x1,y1), …, (xN,yN)}, estimate the parameters of the
prediction function f
◼ Inference(Test): apply f to a never before seen test
example x and output the predicted value y = f(x)
Classification—A Two-Step Process
1. Model construction: based on a training set
9
Classification approaches
◼ K-nearest neighbor classifier (K-nn).
◼ Decision Tree
◼ Naïve Bayes classifier.
10
K-nearest neighbor (K-NN) classifier
✓ K-Nearest Neighbour is one of the simplest Machine Learning
algorithms based on Supervised Learning technique.
✓ A very low value for K such as K=1, can be noisy and lead to
the effects of outliers in the model.
✓ Large values for K are good, but it may find some difficulties.
Example 1
Suppose, we have a dataset for smoking people, with two features (cigarettes and
weight). And we want to know whether vulnerable to a heart attack?
3. Sorting
◼ Test set
Sepal Sepal Petal Petal Species
length width length width
S 4.9 3.0 1.4 0.2 ?
Question: Determine its species using the k-nn algorithm with k=3.
18
Solution
19
Solution
Step 1:
Step 2: Sorting
S2 iris setosa
S1 iris setosa
S3 iris versicolor
S4 iris versicolor
Step 3: Decision
a) A classifier that can predict any field that contains two separate
values, such as a "default" or "non-default" prediction.