AdaBoost

A model based on Boosting.

Training

We have Dataset DD with samples (xd,yd)(x_{d},y_{d}).

  1. Initialize lists
    1. List to hold weights: ww
    2. List to hold classifiers: MM
    3. List to hold weight-updates: β\beta
  2. Initialize weigths for first classifier so that each tuple has the same probability. wi11dw_{i}^1\leftarrow \frac{1}{d}
  3. Generate kk classifiers in kk iterations
  4. At iteration ii do:
    1. Calculate normalized weights: pi=wij=1Nwjip^i=\frac{w^i}{\sum_{j=1}^N w_j^i}
    2. Use Bootstap method to sample Dataset with replacement according to the previously assigned weights to form the training set DiD_{i} for classifier MiM_{i}
    3. Derive model MiM_{i} from DiD_{i}
    4. Test model MiM_{i} with test set DiD_{i} by calculating error ϵi\epsilon_{i} as the sum of all missclassified weights wiw_{i}
    5. If this error is bigger than 0.50.5 go back to step 4.1 and abandon this classifier
    6. Calculate the weight update βi\beta_{i} as ϵi1ϵi\frac{\epsilon_{i}}{1-\epsilon_{i}}
    7. Update weigths for the next iteration by multiplying them with βi\beta_{i} if they have been correctly classified: wii+1=wjiβierr(xj)w_{i}^{i+1}=w_{j}^{i}\beta_{i}^{^-err(x_{j})} thus reducing the weight if they were classified correctly and leaving the weight as it is if it has been missclassified.
    8. Add wi+1,Mi,βiw^{i+1},M_{i},\beta_{i} to their respective lists

Prediction

  1. Initialize weigths of each class to zero
  2. For each classifier
    1. Calculate weight of its vote: wi=log(1βi)w_{i}=\log\left( \frac{1}{\beta_{i}} \right)
    2. Get prediction cc from that weak classifier
    3. Add wiw_{i} to the weight for class cc
  3. Return class with the largest weight

Or in short:

M(x)=argmaxyYi=1k(log1βi)Mi(x)M(x)=\arg \max _{y \in Y} \sum_{i=1}^k\left(\log \frac{1}{\beta_i}\right) M_i(x)