SlideShare une entreprise Scribd logo
1  sur  12
Chapter 3
Classification
Muhammad Umar
UIAI Lab
Table of Contents
 Introduction
 Dataset Exploration
 Loading and Preprocessing Data
 Confusion Matrix
 Precision Recall and F1 Score
 Comparison of Performance Metrices
 Error Analysis
 Summary
Introduction
Figure: Classification Graphically
What basically is Classification?
Classification is a supervised
machine learning algorithms that
aim to learn from labelled data and
predict the class of new or unseen
data.
In this chapter we will explore and experience
the classification techniques used in Machine
Learning.
MNIST Dataset
Dataset Images = 70000 images
28x28 pixels = 784 pixels (features)
Every MNIST data point has two parts:
• Image of the handwritten digit
• Corresponding label (0-9)
Figure: MNIST Dataset
Loading and
Preprocessing
Dataset
•
•
•
Figure: Data Preparation
Confusion
Matrix
Figure: Confusion Matrix
A confusion matrix is a
performance evaluation tool
in machine learning,
representing the accuracy of
a classification model.
Figure: Code Evaluation of CM
Precision Recall
and F1 score
Figure: Precision Recall and F1 Score
Accuracy vs Precision vs Recall vs F1 Score
Metric Definition Use Cases
Accuracy
The proportion of correctly classified
instances (both true positive and true
negative) over all instances.
Measures the overall performance of
a classifier.
Precision
The proportion of correctly classified
positive instances over all instances that
are classified as positive.
Measures the ability of the classifier to
avoid false positives.
Recall
The proportion of correctly classified
positive instances over all actual positive
instances.
Measures the ability of the classifier to
identify all actual positive instances.
F1 Score
The harmonic mean of precision and
recall, providing a balanced measure of
both precision and recall.
A good indicator of the performance of
a classifier when the number of
positive and negative instances is
unbalanced.
Figure: Overall Comparison of Metrices
Error Analysis
Figure: Confusion Matrix
Summary
Accuracy metrics
Confusion Matrix
Precision
Recall
F1 Score
Error Analysis
Comparing OvA vs OvO
Strategy Concept Pros Cons
One vs All
Train a model for each class
vs all others
Simple implementation,
handles some missing data
Imbalanced data issues,
ignores relationships
between classes
One vs One
Train a model for every unique
class pair
Handles imbalanced data
better
More complex to
implement and train
Figure: OvA vs OvO
Thank You

Contenu connexe

Similaire à Classification Chapter 3 Hands on Machine Learning Book

Case Study 2 SCADA WormProtecting the nation’s critical infra.docx
Case Study 2 SCADA WormProtecting the nation’s critical infra.docxCase Study 2 SCADA WormProtecting the nation’s critical infra.docx
Case Study 2 SCADA WormProtecting the nation’s critical infra.docx
wendolynhalbert
 
Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...
Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...
Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...
ijaia
 
notes as .ppt
notes as .pptnotes as .ppt
notes as .ppt
butest
 

Similaire à Classification Chapter 3 Hands on Machine Learning Book (20)

Machine Learning by Rj
Machine Learning by RjMachine Learning by Rj
Machine Learning by Rj
 
Machine Learning - Lecture1.pptx.pdf
Machine Learning - Lecture1.pptx.pdfMachine Learning - Lecture1.pptx.pdf
Machine Learning - Lecture1.pptx.pdf
 
Supervised learning techniques and applications
Supervised learning techniques and applicationsSupervised learning techniques and applications
Supervised learning techniques and applications
 
Introduction to ml
Introduction to mlIntroduction to ml
Introduction to ml
 
MachineLlearning introduction
MachineLlearning introductionMachineLlearning introduction
MachineLlearning introduction
 
Machine learning Mind Map
Machine learning Mind MapMachine learning Mind Map
Machine learning Mind Map
 
Case Study 2 SCADA WormProtecting the nation’s critical infra.docx
Case Study 2 SCADA WormProtecting the nation’s critical infra.docxCase Study 2 SCADA WormProtecting the nation’s critical infra.docx
Case Study 2 SCADA WormProtecting the nation’s critical infra.docx
 
Data Science Project: Advancements in Fetal Health Classification
Data Science Project: Advancements in Fetal Health ClassificationData Science Project: Advancements in Fetal Health Classification
Data Science Project: Advancements in Fetal Health Classification
 
How to understand and implement regression analysis
How to understand and implement regression analysisHow to understand and implement regression analysis
How to understand and implement regression analysis
 
Big Data Analytics.pptx
Big Data Analytics.pptxBig Data Analytics.pptx
Big Data Analytics.pptx
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
 
Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...
Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...
Understanding the Applicability of Linear & Non-Linear Models Using a Case-Ba...
 
Machine learning module 2
Machine learning module 2Machine learning module 2
Machine learning module 2
 
How ml can improve purchase conversions
How ml can improve purchase conversionsHow ml can improve purchase conversions
How ml can improve purchase conversions
 
notes as .ppt
notes as .pptnotes as .ppt
notes as .ppt
 
A Novel Methodology to Implement Optimization Algorithms in Machine Learning
A Novel Methodology to Implement Optimization Algorithms in Machine LearningA Novel Methodology to Implement Optimization Algorithms in Machine Learning
A Novel Methodology to Implement Optimization Algorithms in Machine Learning
 
Churn Analysis in Telecom Industry
Churn Analysis in Telecom IndustryChurn Analysis in Telecom Industry
Churn Analysis in Telecom Industry
 
Predict Backorder on a supply chain data for an Organization
Predict Backorder on a supply chain data for an OrganizationPredict Backorder on a supply chain data for an Organization
Predict Backorder on a supply chain data for an Organization
 
Binary classification metrics_cheatsheet
Binary classification metrics_cheatsheetBinary classification metrics_cheatsheet
Binary classification metrics_cheatsheet
 
Classification and decision tree classifier machine learning
Classification and decision tree classifier machine learningClassification and decision tree classifier machine learning
Classification and decision tree classifier machine learning
 

Dernier

Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
MohammadAliNayeem
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
Kamal Acharya
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
Madan Karki
 

Dernier (20)

Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
Introduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of ArduinoIntroduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of Arduino
 
Introduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsIntroduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and Applications
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
 
Geometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdfGeometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 
Intelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent ActsIntelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent Acts
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor bank
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon
 

Classification Chapter 3 Hands on Machine Learning Book

  • 2. Table of Contents  Introduction  Dataset Exploration  Loading and Preprocessing Data  Confusion Matrix  Precision Recall and F1 Score  Comparison of Performance Metrices  Error Analysis  Summary
  • 3. Introduction Figure: Classification Graphically What basically is Classification? Classification is a supervised machine learning algorithms that aim to learn from labelled data and predict the class of new or unseen data. In this chapter we will explore and experience the classification techniques used in Machine Learning.
  • 4. MNIST Dataset Dataset Images = 70000 images 28x28 pixels = 784 pixels (features) Every MNIST data point has two parts: • Image of the handwritten digit • Corresponding label (0-9) Figure: MNIST Dataset
  • 6. Confusion Matrix Figure: Confusion Matrix A confusion matrix is a performance evaluation tool in machine learning, representing the accuracy of a classification model. Figure: Code Evaluation of CM
  • 7. Precision Recall and F1 score Figure: Precision Recall and F1 Score
  • 8. Accuracy vs Precision vs Recall vs F1 Score Metric Definition Use Cases Accuracy The proportion of correctly classified instances (both true positive and true negative) over all instances. Measures the overall performance of a classifier. Precision The proportion of correctly classified positive instances over all instances that are classified as positive. Measures the ability of the classifier to avoid false positives. Recall The proportion of correctly classified positive instances over all actual positive instances. Measures the ability of the classifier to identify all actual positive instances. F1 Score The harmonic mean of precision and recall, providing a balanced measure of both precision and recall. A good indicator of the performance of a classifier when the number of positive and negative instances is unbalanced. Figure: Overall Comparison of Metrices
  • 11. Comparing OvA vs OvO Strategy Concept Pros Cons One vs All Train a model for each class vs all others Simple implementation, handles some missing data Imbalanced data issues, ignores relationships between classes One vs One Train a model for every unique class pair Handles imbalanced data better More complex to implement and train Figure: OvA vs OvO