ML Unit 2
ML Unit 2
ML Unit 2
UNIT-II
Handling More than Two Classes
• Two Issues:
1. Evaluate Multi-class Performance
2. Build Multi-class models out of binary
Models.
Multi-Class Classification
• Classification tasks with more than two classes.
Precision
• Ability to train only two classes(binary) in
Multiclass .
• Schemes/Methods:
1. One vs Rest. Train (n-1) models
C1, C2, C3……….Cn
or one Rest
C2, C1, C3……….Cn
one Rest
2. One vs One.
Pair of classifiers:
(C1,C2)=(C2,C1)Symmetry then n(n-1)/2 models
(C1,C2)≠(C2,C1)Asymmetry then n(n-1) models
Output Code Matrix
One vs One
C1 C1
C2 C2
C3 C3
Symmetric(ordered) Asymmetric(unordered)
(C1,C2)=(C2,C1) (C1,C2) ≠ (C2,C1)
(C1,C3)=(C3,C1) (C1,C3) ≠ (C3,C1)
(C2,C3)=(C3,C2) (C2,C3) ≠ (C3,C2)
One vs Rest
For Ex: C1, C2, C3
• C1 +ve then C2, C3 are -ve.
• C2 +ve then C1, C3 are -ve.
• C3 +ve then C1, C2 are –ve.
• C1-C2-C3, C3-C1
C1 C1
C2 C2
C3 C3
To predict the class for a particular instance
• (F(x)-F’(x))