SlideShare a Scribd company logo
1 of 29
Multiclass Classification
Sergey Ivanov
Plan
1. Presentation on Multiclass Classification
a. Error Rates and the Bayes Classifier
b. Gaussian and Linear Classifiers. Linear Discriminant Analysis.
Logistic Regression;
c. Multi-class classification models and methods;
d. Multi-class strategies: one-versus-all, one-versus-one, error-
correction-codes
2. Linear Classifiers and Multi-classification Tutorial
3. In-class exercise
1. Multilabel Classification format
2. Classifier Comparison
3. LDA as dimensionality reduction
4. LDA vs PCA
5. Logistic Regression for 3 classes
6. Linear models
7. LDA and QDA
8. Naive Regression
9. Cross Validation in Python
References
Naive Bayes
Naive Bayes
Naive Bayes
Naive Bayes
Naive Bayes
Naive Bayes
1. Gaussian NB
2. Bernoulli NB
Naive Bayes
Pros:
1. Fast
2. Prevent curse of dimensionality
3. Decent classifier for several
tasks (e.g. text classification)
4. Inherently multiclass
Cons:
1. Bad estimator of probabilities to
the class.
Linear/Quadratic Discriminant Analysis (LDA/QDA)
Linear/Quadratic Discriminant Analysis (LDA/QDA)
Linear/Quadratic Discriminant Analysis (LDA/QDA)
● LDA = each class has the
same covariance equals to
averaged covariance of the
classes
● QDA = each class has its
own covariance
Linear/Quadratic Discriminant Analysis (LDA/QDA)
Pros:
1. Closed-Form solution
2. Inherently Multiclass
3. No hyperparameters tuning
4. Can be used as dimensionality
reduction
Cons:
1. Assume unimodal Gaussian
distribution for each class
2. Cannot reduce dimensions to
more than the number of
classes.
3. Not useful if “information” is in
data variance instead of the
mean of classes.
Stochastic Gradient Descent (SGD)
Loss functions L:
Stochastic Gradient Descent (SGD)
Regularization Term R:
Stochastic Gradient Descent (SGD)
Stochastic Gradient Descent (SGD)
Stochastic Gradient Descent (SGD)
Practical Tips:
● Scale data so that each dimension has unit variance and zero
mean. StandardScaler() in Python.
● Empirically, n_iter = np.ceil(10**6 / n)
● Averaged SGD works best with large number of features.
● After PCA, multiply training data by c such that L2 norm will be
equals to 1.
Stochastic Gradient Descent (SGD)
Pros:
1. Fast
2. Ease of implementation
3. Sound theoretical results
Cons:
1. Hyperparameters tuning
2. Sensitive to feature scaling
3. Not multiclass
Multilabel and Multiclass classification
● Multiclass: classifying more than 2 classes. For
example, classifying digits.
● Multilabel: assigning a set of topics to each sample.
For example, assignment of topics to an article.
● Multioutput-multiclass: fixed number of output
variables, each of which can take on arbitrary number
of values. For example, predicting a fruit and its color,
where each fruit can take on arbitrary set of values
from {‘blue’, ‘orange’, ‘green’, ‘white’,...}.
Multilabel and Multiclass classification
● Inherent Multiclass: Naive Bayes,
LDA/QDA, DT, Random Forest, kNN
● One-vs-Rest
● One-vs-One
● Error-Correcting Output Codes
One-vs-Rest (OVR)
One-vs-Rest (OVR)
One-vs-Rest (OVR)
Training: Fits one classifier per
class against all other data as a
negative class. In total K classifiers.
Prediction: applies K classifiers to a
new data point. Selects the one
that got a positive class. In case of
ties, selects the class with highest
confidence.
Pros:
● Efficient
● Interpretable
One-vs-One (OVO)
One-vs-One (OVO)
Training: Fits (K-1) classifier per
class against each other class. In
total K*(K-1)/2 classifiers.
Prediction: applies K*(K-1)/2
classifiers to a new data point.
Selects the class that got the
majority of votes (“+1”). In case of
ties, selects the class with highest
confidence.
Pros:
● Used for Kernel algorithms (e.g.
“SVM”).
Cons:
● Not as fast as OVR
Error-Correcting Output Codes (ECOC)
Training: 1) Obtain a binary
codeword for each class of
length c. 2) Learn a separate
binary classifier for each position
of a codeword. In total, c
classifiers.
Prediction: Apply c classifiers to
a new data point and select the
class closest to a datapoint by
Hamming distance.
Error-Correcting Output Codes (ECOC)
How to obtain codewords?
1) Row separation
2) Column separation
Pros:
● Can be more
correct than
OVR
Multilabel and Multiclass classification
● Inherent Multiclass: Naive Bayes,
LDA/QDA, DT, Random Forest, kNN
● One-vs-Rest
● One-vs-One
● Error-Correcting Output Codes

More Related Content

What's hot

Feature Engineering
Feature EngineeringFeature Engineering
Feature EngineeringHJ van Veen
 
Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Usama Fayyaz
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnnKuppusamy P
 
Types of Machine Learning
Types of Machine LearningTypes of Machine Learning
Types of Machine LearningSamra Shahzadi
 
Introdution and designing a learning system
Introdution and designing a learning systemIntrodution and designing a learning system
Introdution and designing a learning systemswapnac12
 
Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods Marina Santini
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...Simplilearn
 
. An introduction to machine learning and probabilistic ...
. An introduction to machine learning and probabilistic .... An introduction to machine learning and probabilistic ...
. An introduction to machine learning and probabilistic ...butest
 
What is the Expectation Maximization (EM) Algorithm?
What is the Expectation Maximization (EM) Algorithm?What is the Expectation Maximization (EM) Algorithm?
What is the Expectation Maximization (EM) Algorithm?Kazuki Yoshida
 
Classification and Regression
Classification and RegressionClassification and Regression
Classification and RegressionMegha Sharma
 
Introduction to Model-Based Machine Learning
Introduction to Model-Based Machine LearningIntroduction to Model-Based Machine Learning
Introduction to Model-Based Machine LearningDaniel Emaasit
 
Unsupervised learning (clustering)
Unsupervised learning (clustering)Unsupervised learning (clustering)
Unsupervised learning (clustering)Pravinkumar Landge
 
Linear regression
Linear regressionLinear regression
Linear regressionMartinHogg9
 
Feature Selection in Machine Learning
Feature Selection in Machine LearningFeature Selection in Machine Learning
Feature Selection in Machine LearningUpekha Vandebona
 
Feature Engineering
Feature Engineering Feature Engineering
Feature Engineering odsc
 
Kernels and Support Vector Machines
Kernels and Support Vector  MachinesKernels and Support Vector  Machines
Kernels and Support Vector MachinesEdgar Marca
 

What's hot (20)

Feature Engineering
Feature EngineeringFeature Engineering
Feature Engineering
 
supervised learning
supervised learningsupervised learning
supervised learning
 
Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
 
Types of Machine Learning
Types of Machine LearningTypes of Machine Learning
Types of Machine Learning
 
Introdution and designing a learning system
Introdution and designing a learning systemIntrodution and designing a learning system
Introdution and designing a learning system
 
Support Vector machine
Support Vector machineSupport Vector machine
Support Vector machine
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
 
. An introduction to machine learning and probabilistic ...
. An introduction to machine learning and probabilistic .... An introduction to machine learning and probabilistic ...
. An introduction to machine learning and probabilistic ...
 
Kmeans
KmeansKmeans
Kmeans
 
What is the Expectation Maximization (EM) Algorithm?
What is the Expectation Maximization (EM) Algorithm?What is the Expectation Maximization (EM) Algorithm?
What is the Expectation Maximization (EM) Algorithm?
 
Classification and Regression
Classification and RegressionClassification and Regression
Classification and Regression
 
Introduction to Model-Based Machine Learning
Introduction to Model-Based Machine LearningIntroduction to Model-Based Machine Learning
Introduction to Model-Based Machine Learning
 
Unsupervised learning (clustering)
Unsupervised learning (clustering)Unsupervised learning (clustering)
Unsupervised learning (clustering)
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Feature Selection in Machine Learning
Feature Selection in Machine LearningFeature Selection in Machine Learning
Feature Selection in Machine Learning
 
Feature Engineering
Feature Engineering Feature Engineering
Feature Engineering
 
Kernels and Support Vector Machines
Kernels and Support Vector  MachinesKernels and Support Vector  Machines
Kernels and Support Vector Machines
 

Viewers also liked

Plantilla presentacion
Plantilla presentacionPlantilla presentacion
Plantilla presentacionhome
 
Unit 4, Lesson 1.ppt
Unit 4, Lesson 1.pptUnit 4, Lesson 1.ppt
Unit 4, Lesson 1.pptCasey Patrick
 
presentacion de windows
presentacion de windowspresentacion de windows
presentacion de windowsjosepazr
 
Unit 4, Lesson 2.ppt
Unit 4, Lesson 2.pptUnit 4, Lesson 2.ppt
Unit 4, Lesson 2.pptCasey Patrick
 
Unit 4, Lesson 3.ppt
Unit 4, Lesson 3.pptUnit 4, Lesson 3.ppt
Unit 4, Lesson 3.pptCasey Patrick
 
мо вихователів та класних керівників І ступеню
мо вихователів та класних керівників І ступенюмо вихователів та класних керівників І ступеню
мо вихователів та класних керівників І ступенюНадежда Сорока
 
CONTABILIDAD MELISSA
CONTABILIDAD MELISSACONTABILIDAD MELISSA
CONTABILIDAD MELISSAmelorios2001
 
Enhancement of Palmprint using Median Filter for Biometrics Application
Enhancement of Palmprint using Median Filter for Biometrics ApplicationEnhancement of Palmprint using Median Filter for Biometrics Application
Enhancement of Palmprint using Median Filter for Biometrics ApplicationMangilal Saraswat
 
Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Ismail Mukiibi
 
Computer architecture kai hwang
Computer architecture   kai hwangComputer architecture   kai hwang
Computer architecture kai hwangSumedha
 

Viewers also liked (20)

El perro del hortelano
El perro del hortelanoEl perro del hortelano
El perro del hortelano
 
" ASTM"
" ASTM"" ASTM"
" ASTM"
 
Plantilla presentacion
Plantilla presentacionPlantilla presentacion
Plantilla presentacion
 
Vivir es fácil...
Vivir es fácil... Vivir es fácil...
Vivir es fácil...
 
Unit 4, Lesson 1.ppt
Unit 4, Lesson 1.pptUnit 4, Lesson 1.ppt
Unit 4, Lesson 1.ppt
 
Que es Contabilidad
Que es ContabilidadQue es Contabilidad
Que es Contabilidad
 
100410 254 tracol2
100410 254 tracol2100410 254 tracol2
100410 254 tracol2
 
presentacion de windows
presentacion de windowspresentacion de windows
presentacion de windows
 
Hermosa juventud
Hermosa juventudHermosa juventud
Hermosa juventud
 
Solution
SolutionSolution
Solution
 
15 años y 1 día
15 años y 1 día15 años y 1 día
15 años y 1 día
 
Unit 4, Lesson 2.ppt
Unit 4, Lesson 2.pptUnit 4, Lesson 2.ppt
Unit 4, Lesson 2.ppt
 
Unit 4, Lesson 3.ppt
Unit 4, Lesson 3.pptUnit 4, Lesson 3.ppt
Unit 4, Lesson 3.ppt
 
Election Form 7
Election Form 7Election Form 7
Election Form 7
 
мо вихователів та класних керівників І ступеню
мо вихователів та класних керівників І ступенюмо вихователів та класних керівників І ступеню
мо вихователів та класних керівників І ступеню
 
CONTABILIDAD MELISSA
CONTABILIDAD MELISSACONTABILIDAD MELISSA
CONTABILIDAD MELISSA
 
Enhancement of Palmprint using Median Filter for Biometrics Application
Enhancement of Palmprint using Median Filter for Biometrics ApplicationEnhancement of Palmprint using Median Filter for Biometrics Application
Enhancement of Palmprint using Median Filter for Biometrics Application
 
Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6
 
VLIW Processors
VLIW ProcessorsVLIW Processors
VLIW Processors
 
Computer architecture kai hwang
Computer architecture   kai hwangComputer architecture   kai hwang
Computer architecture kai hwang
 

Similar to Linear models and multiclass classification

Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive ModelsDatamining Tools
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Modelsguest0edcaf
 
Chapter 11 KNN Naive Bayes and LDA.pptx
Chapter 11 KNN  Naive Bayes and LDA.pptxChapter 11 KNN  Naive Bayes and LDA.pptx
Chapter 11 KNN Naive Bayes and LDA.pptxkiitlabsbsc
 
Statistical Pattern recognition(1)
Statistical Pattern recognition(1)Statistical Pattern recognition(1)
Statistical Pattern recognition(1)Syed Atif Naseem
 
QUALITY AND VALIDITY of cluster analysis in data minig
QUALITY AND VALIDITY of cluster analysis in data minigQUALITY AND VALIDITY of cluster analysis in data minig
QUALITY AND VALIDITY of cluster analysis in data minigsani7728264
 
QUALITY AND VALIDITY OF CLUSTER ANALYSIS
QUALITY AND VALIDITY OF CLUSTER ANALYSISQUALITY AND VALIDITY OF CLUSTER ANALYSIS
QUALITY AND VALIDITY OF CLUSTER ANALYSISguruswamyd785
 
20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.pptSamPrem3
 
20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.pptPalaniKumarR2
 
Classification Systems
Classification SystemsClassification Systems
Classification SystemsJohn Reiser
 
IRJET- Ordinal based Classification Techniques: A Survey
IRJET-  	  Ordinal based Classification Techniques: A SurveyIRJET-  	  Ordinal based Classification Techniques: A Survey
IRJET- Ordinal based Classification Techniques: A SurveyIRJET Journal
 
Singular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptxSingular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptxrajalakshmi5921
 
EDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptxEDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptxrajalakshmi5921
 

Similar to Linear models and multiclass classification (20)

Supervised Learning.pptx
Supervised Learning.pptxSupervised Learning.pptx
Supervised Learning.pptx
 
Classification
ClassificationClassification
Classification
 
Classification
ClassificationClassification
Classification
 
[ppt]
[ppt][ppt]
[ppt]
 
[ppt]
[ppt][ppt]
[ppt]
 
Clustering
ClusteringClustering
Clustering
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
 
Chapter 11 KNN Naive Bayes and LDA.pptx
Chapter 11 KNN  Naive Bayes and LDA.pptxChapter 11 KNN  Naive Bayes and LDA.pptx
Chapter 11 KNN Naive Bayes and LDA.pptx
 
Statistical Pattern recognition(1)
Statistical Pattern recognition(1)Statistical Pattern recognition(1)
Statistical Pattern recognition(1)
 
QUALITY AND VALIDITY of cluster analysis in data minig
QUALITY AND VALIDITY of cluster analysis in data minigQUALITY AND VALIDITY of cluster analysis in data minig
QUALITY AND VALIDITY of cluster analysis in data minig
 
QUALITY AND VALIDITY OF CLUSTER ANALYSIS
QUALITY AND VALIDITY OF CLUSTER ANALYSISQUALITY AND VALIDITY OF CLUSTER ANALYSIS
QUALITY AND VALIDITY OF CLUSTER ANALYSIS
 
20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt
 
20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt
 
Classification Systems
Classification SystemsClassification Systems
Classification Systems
 
IRJET- Ordinal based Classification Techniques: A Survey
IRJET-  	  Ordinal based Classification Techniques: A SurveyIRJET-  	  Ordinal based Classification Techniques: A Survey
IRJET- Ordinal based Classification Techniques: A Survey
 
Biehl hanze-2021
Biehl hanze-2021Biehl hanze-2021
Biehl hanze-2021
 
Singular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptxSingular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptx
 
EDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptxEDAB Module 5 Singular Value Decomposition (SVD).pptx
EDAB Module 5 Singular Value Decomposition (SVD).pptx
 

Recently uploaded

Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxnoorehahmad
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...NETWAYS
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxCarrieButtitta
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptssuser319dad
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGYpruthirajnayak525
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)Basil Achie
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@vikas rana
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !risocarla2016
 

Recently uploaded (20)

Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
 
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
Open Source Camp Kubernetes 2024 | Monitoring Kubernetes With Icinga by Eric ...
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptx
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.ppt
 
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC  - NANOTECHNOLOGYPHYSICS PROJECT BY MSC  - NANOTECHNOLOGY
PHYSICS PROJECT BY MSC - NANOTECHNOLOGY
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Rohini Delhi 💯Call Us 🔝8264348440🔝
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !James Joyce, Dubliners and Ulysses.ppt !
James Joyce, Dubliners and Ulysses.ppt !
 

Linear models and multiclass classification

  • 2. Plan 1. Presentation on Multiclass Classification a. Error Rates and the Bayes Classifier b. Gaussian and Linear Classifiers. Linear Discriminant Analysis. Logistic Regression; c. Multi-class classification models and methods; d. Multi-class strategies: one-versus-all, one-versus-one, error- correction-codes 2. Linear Classifiers and Multi-classification Tutorial 3. In-class exercise 1. Multilabel Classification format 2. Classifier Comparison 3. LDA as dimensionality reduction 4. LDA vs PCA 5. Logistic Regression for 3 classes 6. Linear models 7. LDA and QDA 8. Naive Regression 9. Cross Validation in Python References
  • 8. Naive Bayes 1. Gaussian NB 2. Bernoulli NB
  • 9. Naive Bayes Pros: 1. Fast 2. Prevent curse of dimensionality 3. Decent classifier for several tasks (e.g. text classification) 4. Inherently multiclass Cons: 1. Bad estimator of probabilities to the class.
  • 12. Linear/Quadratic Discriminant Analysis (LDA/QDA) ● LDA = each class has the same covariance equals to averaged covariance of the classes ● QDA = each class has its own covariance
  • 13. Linear/Quadratic Discriminant Analysis (LDA/QDA) Pros: 1. Closed-Form solution 2. Inherently Multiclass 3. No hyperparameters tuning 4. Can be used as dimensionality reduction Cons: 1. Assume unimodal Gaussian distribution for each class 2. Cannot reduce dimensions to more than the number of classes. 3. Not useful if “information” is in data variance instead of the mean of classes.
  • 14. Stochastic Gradient Descent (SGD) Loss functions L:
  • 15. Stochastic Gradient Descent (SGD) Regularization Term R:
  • 18. Stochastic Gradient Descent (SGD) Practical Tips: ● Scale data so that each dimension has unit variance and zero mean. StandardScaler() in Python. ● Empirically, n_iter = np.ceil(10**6 / n) ● Averaged SGD works best with large number of features. ● After PCA, multiply training data by c such that L2 norm will be equals to 1.
  • 19. Stochastic Gradient Descent (SGD) Pros: 1. Fast 2. Ease of implementation 3. Sound theoretical results Cons: 1. Hyperparameters tuning 2. Sensitive to feature scaling 3. Not multiclass
  • 20. Multilabel and Multiclass classification ● Multiclass: classifying more than 2 classes. For example, classifying digits. ● Multilabel: assigning a set of topics to each sample. For example, assignment of topics to an article. ● Multioutput-multiclass: fixed number of output variables, each of which can take on arbitrary number of values. For example, predicting a fruit and its color, where each fruit can take on arbitrary set of values from {‘blue’, ‘orange’, ‘green’, ‘white’,...}.
  • 21. Multilabel and Multiclass classification ● Inherent Multiclass: Naive Bayes, LDA/QDA, DT, Random Forest, kNN ● One-vs-Rest ● One-vs-One ● Error-Correcting Output Codes
  • 24. One-vs-Rest (OVR) Training: Fits one classifier per class against all other data as a negative class. In total K classifiers. Prediction: applies K classifiers to a new data point. Selects the one that got a positive class. In case of ties, selects the class with highest confidence. Pros: ● Efficient ● Interpretable
  • 26. One-vs-One (OVO) Training: Fits (K-1) classifier per class against each other class. In total K*(K-1)/2 classifiers. Prediction: applies K*(K-1)/2 classifiers to a new data point. Selects the class that got the majority of votes (“+1”). In case of ties, selects the class with highest confidence. Pros: ● Used for Kernel algorithms (e.g. “SVM”). Cons: ● Not as fast as OVR
  • 27. Error-Correcting Output Codes (ECOC) Training: 1) Obtain a binary codeword for each class of length c. 2) Learn a separate binary classifier for each position of a codeword. In total, c classifiers. Prediction: Apply c classifiers to a new data point and select the class closest to a datapoint by Hamming distance.
  • 28. Error-Correcting Output Codes (ECOC) How to obtain codewords? 1) Row separation 2) Column separation Pros: ● Can be more correct than OVR
  • 29. Multilabel and Multiclass classification ● Inherent Multiclass: Naive Bayes, LDA/QDA, DT, Random Forest, kNN ● One-vs-Rest ● One-vs-One ● Error-Correcting Output Codes

Editor's Notes

  1. http://scikit-learn.org/stable/modules/naive_bayes.html
  2. http://scikit-learn.org/stable/modules/naive_bayes.html
  3. http://scikit-learn.org/stable/modules/naive_bayes.html
  4. http://scikit-learn.org/stable/modules/naive_bayes.html
  5. http://scikit-learn.org/stable/modules/naive_bayes.html
  6. http://scikit-learn.org/stable/modules/naive_bayes.html
  7. http://scikit-learn.org/stable/modules/naive_bayes.html
  8. http://scikit-learn.org/stable/modules/lda_qda.html
  9. http://scikit-learn.org/stable/modules/lda_qda.html
  10. http://scikit-learn.org/stable/modules/lda_qda.html
  11. http://scikit-learn.org/stable/modules/lda_qda.html
  12. http://scikit-learn.org/stable/modules/sgd.html#mathematical-formulation
  13. http://scikit-learn.org/stable/modules/sgd.html#mathematical-formulation
  14. http://scikit-learn.org/stable/modules/sgd.html#mathematical-formulation
  15. http://scikit-learn.org/stable/modules/sgd.html#mathematical-formulation
  16. http://scikit-learn.org/stable/modules/sgd.html#tips-on-practical-use
  17. http://scikit-learn.org/stable/modules/sgd.html#mathematical-formulation
  18. http://scikit-learn.org/stable/modules/multiclass.html#multiclass-and-multilabel-algorithms
  19. http://scikit-learn.org/stable/modules/multiclass.html#multiclass-and-multilabel-algorithms
  20. http://scikit-learn.org/stable/modules/multiclass.html#one-vs-the-rest
  21. http://scikit-learn.org/stable/modules/multiclass.html#one-vs-the-rest
  22. http://scikit-learn.org/stable/modules/multiclass.html#one-vs-the-rest
  23. http://scikit-learn.org/stable/modules/multiclass.html#one-vs-the-rest
  24. http://scikit-learn.org/stable/modules/multiclass.html#one-vs-one
  25. http://www.jair.org/media/105/live-105-1426-jair.pdf http://scikit-learn.org/stable/modules/generated/sklearn.multiclass.OutputCodeClassifier.html#sklearn.multiclass.OutputCodeClassifier
  26. http://www.jair.org/media/105/live-105-1426-jair.pdf 7 page http://scikit-learn.org/stable/modules/generated/sklearn.multiclass.OutputCodeClassifier.html#sklearn.multiclass.OutputCodeClassifier
  27. http://scikit-learn.org/stable/modules/multiclass.html#multiclass-and-multilabel-algorithms