Professional Documents
Culture Documents
Classification
Classification
Chapter : Classification
Marouane Ben Haj Ayech
Outline
• Presentation
• KNN
• Learning process
• Prediction process
• Evaluation
2
Presentation
• Prediction
Prediction task Description Output Nature Examples
• Learning
Learning Type Dataset Type Prediction Tasks Learning models
K-Nearest Neighbors (KNN)
Naïve Bayes
Supervised Labeled Classification Decision Tree
Logistic Regression
Réseau de neurones
3
Presentation
Classification problem
x=house=(surface , nb rooms) y=class label ∈ {0 = ′cheap′,′expensive′}
input output
Learning Prediction
process process
nb rooms nb rooms
nb rooms
4
K Nearest Neighbors (KNN)
Technique Learning Process Prediction Process Hyperparameters
- Given a new data point x, KNN computes
the distances between all training data
a non-parametric - K : The number of K
points and x
technique nearest neighbors
- The points are sorted based on their
KNN does’nt learn a - Distance metric
KNN distances (ascending sort)
model (Euclidean, …)
- x takes the dominant class label of the set
of K nearest neighbors
Model
- The training dataset
5
KNN
• Learning process
Model of classifier
classe cheap Model
classe expensive classe cheap
surface surface classe expensive
nb rooms nb rooms
KNN
• Prediction process K=3
surface new
house Major class
is cheap
nb rooms
Evaluation
• The evaluation is performed using a test dataset that has a .
• most used metrics to evaluate the model (classifier) performance are:
• Confusion matrix
• Accuracy score
• Recall
• Precision
Predicted
Example Predicted