SlideShare a Scribd company logo
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

Ensemble methods
Ensemble methodsEnsemble methods
Ensemble methods
Christopher Marker
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
Mohammad Junaid Khan
 
Understanding Bagging and Boosting
Understanding Bagging and BoostingUnderstanding Bagging and Boosting
Understanding Bagging and Boosting
Mohit Rajput
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
Knoldus Inc.
 
boosting algorithm
boosting algorithmboosting algorithm
boosting algorithm
Prithvi Paneru
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
MartinHogg9
 
Computational learning theory
Computational learning theoryComputational learning theory
Computational learning theory
swapnac12
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining
Sulman Ahmed
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Example
kailash shaw
 
K-Nearest Neighbor Classifier
K-Nearest Neighbor ClassifierK-Nearest Neighbor Classifier
K-Nearest Neighbor Classifier
Neha Kulkarni
 
Clustering
ClusteringClustering
Clustering
Rashmi Bhat
 
Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods
Marina Santini
 
Feature scaling
Feature scalingFeature scaling
Feature scaling
Gautam Kumar
 
AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
Tajim Md. Niamat Ullah Akhund
 
Linear regression with gradient descent
Linear regression with gradient descentLinear regression with gradient descent
Linear regression with gradient descent
Suraj Parmar
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
kishanthkumaar
 
Text Classification
Text ClassificationText Classification
Text Classification
RAX Automation Suite
 
2.3 bayesian classification
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classification
Krish_ver2
 

What's hot (20)

Ensemble methods
Ensemble methodsEnsemble methods
Ensemble methods
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
 
Understanding Bagging and Boosting
Understanding Bagging and BoostingUnderstanding Bagging and Boosting
Understanding Bagging and Boosting
 
Hierachical clustering
Hierachical clusteringHierachical clustering
Hierachical clustering
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
 
boosting algorithm
boosting algorithmboosting algorithm
boosting algorithm
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Computational learning theory
Computational learning theoryComputational learning theory
Computational learning theory
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Example
 
K-Nearest Neighbor Classifier
K-Nearest Neighbor ClassifierK-Nearest Neighbor Classifier
K-Nearest Neighbor Classifier
 
Clustering
ClusteringClustering
Clustering
 
Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods Lecture 6: Ensemble Methods
Lecture 6: Ensemble Methods
 
Feature scaling
Feature scalingFeature scaling
Feature scaling
 
AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
 
Linear regression with gradient descent
Linear regression with gradient descentLinear regression with gradient descent
Linear regression with gradient descent
 
Machine Learning-Linear regression
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
 
Text Classification
Text ClassificationText Classification
Text Classification
 
2.3 bayesian classification
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classification
 

Viewers also liked

El perro del hortelano
El perro del hortelanoEl perro del hortelano
El perro del hortelano
Bernard Sanjuan
 
" ASTM"
" ASTM"" ASTM"
Plantilla presentacion
Plantilla presentacionPlantilla presentacion
Plantilla presentacion
home
 
Vivir es fácil...
Vivir es fácil... Vivir es fácil...
Vivir es fácil...
Bernard Sanjuan
 
Unit 4, Lesson 1.ppt
Unit 4, Lesson 1.pptUnit 4, Lesson 1.ppt
Unit 4, Lesson 1.ppt
Casey Patrick
 
Que es Contabilidad
Que es ContabilidadQue es Contabilidad
Que es Contabilidad
Sebastian Barraza
 
100410 254 tracol2
100410 254 tracol2100410 254 tracol2
100410 254 tracol2
andres mendoza
 
presentacion de windows
presentacion de windowspresentacion de windows
presentacion de windows
josepazr
 
Hermosa juventud
Hermosa juventudHermosa juventud
Hermosa juventud
Bernard Sanjuan
 
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
Bernard Sanjuan
 
Unit 4, Lesson 2.ppt
Unit 4, Lesson 2.pptUnit 4, Lesson 2.ppt
Unit 4, Lesson 2.ppt
Casey Patrick
 
Unit 4, Lesson 3.ppt
Unit 4, Lesson 3.pptUnit 4, Lesson 3.ppt
Unit 4, Lesson 3.ppt
Casey Patrick
 
Election Form 7
Election Form 7Election Form 7
Election Form 7
Rupali Ghogle
 
мо вихователів та класних керівників І ступеню
мо вихователів та класних керівників І ступенюмо вихователів та класних керівників І ступеню
мо вихователів та класних керівників І ступеню
Надежда Сорока
 
CONTABILIDAD MELISSA
CONTABILIDAD MELISSACONTABILIDAD MELISSA
CONTABILIDAD MELISSA
melorios2001
 
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
Mangilal 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 6
Ismail Mukiibi
 
VLIW Processors
VLIW ProcessorsVLIW Processors
VLIW Processors
Sudhanshu Janwadkar
 
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

Supervised Learning.pptx
Supervised Learning.pptxSupervised Learning.pptx
Classification
ClassificationClassification
Classification
DataminingTools Inc
 
Classification
ClassificationClassification
Classification
Datamining Tools
 
Clustering
ClusteringClustering
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
guest0edcaf
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
Datamining Tools
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
DataminingTools Inc
 
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
kiitlabsbsc
 
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
QUALITY AND VALIDITY OF CLUSTER ANALYSISQUALITY AND VALIDITY OF CLUSTER ANALYSIS
QUALITY AND VALIDITY OF CLUSTER ANALYSIS
guruswamyd785
 
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
sani7728264
 
20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt
SamPrem3
 
20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt20IT501_DWDM_PPT_Unit_IV.ppt
20IT501_DWDM_PPT_Unit_IV.ppt
PalaniKumarR2
 
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 Survey
IRJET Journal
 
Biehl hanze-2021
Biehl hanze-2021Biehl hanze-2021
Biehl hanze-2021
University of Groningen
 
Singular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptxSingular Value Decomposition (SVD).pptx
Singular Value Decomposition (SVD).pptx
rajalakshmi5921
 
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
rajalakshmi5921
 

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
QUALITY AND VALIDITY OF CLUSTER ANALYSISQUALITY AND VALIDITY OF CLUSTER ANALYSIS
QUALITY AND VALIDITY OF CLUSTER ANALYSIS
 
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
 
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

Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
IP ServerOne
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
eCommerce Institute
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
OWASP Beja
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
khadija278284
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
Faculty of Medicine And Health Sciences
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Orkestra
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Sebastiano Panichella
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
Access Innovations, Inc.
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Matjaž Lipuš
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
Vladimir Samoylov
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Sebastiano Panichella
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
Sebastiano Panichella
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
Howard Spence
 

Recently uploaded (16)

Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
 
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
 

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