AlvaroCorrales / AdaBoost

MIT License
8 stars 6 forks source link

Can this work for multi-class? #2

Open super-ask opened 3 years ago

super-ask commented 3 years ago

Hi @AlvaroCorrales,

Just a quick question please. I thought M1 is the extension of AdaBoost for multi-class? I tried using this implementation for multi-class, the output is just a binary classification Confusion matrix:

[
[ 9074  5527 0 0 0]
[ 564  834  0 0 0]
[ 1728 6589  0 0 0]
[ 1799 18502 0 0 0]
[ 373   531   0  0 0]
]

Classification report:

             precision    recall  f1-score   support

     Class:0       0.67      0.62      0.64     14601
     Class:1       0.03      0.60      0.05      1398
     Class:2       0.00      0.00      0.00      8317
     Class:3       0.00      0.00      0.00     20301
     Class:4       0.00      0.00      0.00       904

    accuracy                           0.22     45521
   macro avg       0.14      0.24      0.14     45521
weighted avg       0.22      0.22      0.21     45521

What's you suggestion working with multi-class using this implementation?

AlvaroCorrales commented 3 years ago

You can extend AdaBoost to multiclass, but there are two problems you would need to overcome: 1) I am not sure how you would predict multiple (i.e. >2) classes with stumps. I'd say you just can't a simple decission tree classifier like I did. You'd have to think how you classify multiple labels with trees that only draw one decision boundary. 2) The voting mechanism in my implementation is such that it takes the sign of the sum of individual predictions by the stumps. I can do this because I only have two labels: 1 and -1. In a multiclass setting, this wouldn't work. You'd have to take the mode of your stump predictions.