SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Classification Algorithm.
Classification Algorithm.Classification Algorithm.
Classification Algorithm.Megha Sharma
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Edureka!
 
Random forest
Random forestRandom forest
Random forestUjjawal
 
Decision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learningDecision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learningAbhishek Vijayvargia
 
NAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERKnoldus Inc.
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning Mohammad Junaid Khan
 
Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machinesnextlib
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmPınar Yahşi
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsMd. Main Uddin Rony
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersFunctional Imperative
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature EngineeringHJ van Veen
 
Supervised Machine Learning Techniques
Supervised Machine Learning TechniquesSupervised Machine Learning Techniques
Supervised Machine Learning TechniquesTara ram Goyal
 

Tendances (20)

Support Vector machine
Support Vector machineSupport Vector machine
Support Vector machine
 
Classification Algorithm.
Classification Algorithm.Classification Algorithm.
Classification Algorithm.
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
Logistic Regression in Python | Logistic Regression Example | Machine Learnin...
 
Random forest
Random forestRandom forest
Random forest
 
Decision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learningDecision tree, softmax regression and ensemble methods in machine learning
Decision tree, softmax regression and ensemble methods in machine learning
 
KNN
KNNKNN
KNN
 
NAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIER
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
 
Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machines
 
Naive Bayes Presentation
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes Presentation
 
Support vector machine-SVM's
Support vector machine-SVM'sSupport vector machine-SVM's
Support vector machine-SVM's
 
DBSCAN : A Clustering Algorithm
DBSCAN : A Clustering AlgorithmDBSCAN : A Clustering Algorithm
DBSCAN : A Clustering Algorithm
 
Classification Based Machine Learning Algorithms
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature Engineering
 
Decision Tree Learning
Decision Tree LearningDecision Tree Learning
Decision Tree Learning
 
Supervised Machine Learning Techniques
Supervised Machine Learning TechniquesSupervised Machine Learning Techniques
Supervised Machine Learning Techniques
 
Ensemble methods
Ensemble methods Ensemble methods
Ensemble methods
 

En vedette

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
 

En vedette (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
 

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

Similaire à 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
 

Dernier

Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 

Dernier (20)

Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 

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

Notes de l'éditeur

  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