Skip to main content
. 2022 Jul 28;9(8):350. doi: 10.3390/bioengineering9080350
Algorithm 1: Conventional AdaBoost technique
Input: training dataset S=x1,y1,,x2,y2,,xn,yn, base learner h, the number of training rounds T.
Output: the final strong classifier H.
Procedure:
  • 1.

    for i=1:1:n

  • 2.

    compute the weight of the sample xi: D1i=1n

  • 3.

    end for

  • 4.

    for t=1:1:T

  • 5.

    select a training data subset X from S, fit h using X to get a weak classifier ht, compute the classification error εt: εt=Phtxiyi=i=1nDtiΙhtxiyi

    where htxi denotes the predicted label of xi using the weak classifier ht, and yi denotes the actual label of xi.

  • 6.

    compute the weight of ht: αt=12ln1εtεt

  • 7.

    update the weight of all the instances in S:

    for i=1:1:n

    Dt+1i=DtiZtexpαtyihtxi

    where Zt is a normalization factor and is calculated as: Zt=i=1nDtiexpαtyihtxi

  • 8.

    end for

  • 9.

    end for

  • 10.

    assuming Hx is the class label for an instance x; after the iterations, the final classifier H is obtained as: Hx=signt=1Tαthtx