|
Algorithm 2: Cost-Sensitive AdaBoost |
|
Input: training dataset , base learner , the number of iterations . |
|
Output: the final strong classifier . |
Procedure:
-
1.
for
-
2.
compute the weight of the sample :
-
3.
end for
-
4.
for
-
5.
select a training data subset from , fit using to get a weak classifier
-
6.
let and indicate the positive and negative classes, respectively. Compute the error rate of the base learner for both the positive class and negative class : where
-
7.
compute the weight of :
-
8.
update the weight of all the instances in :
for
where is a normalization factor and is calculated as:
and is calculated as:
where , , , are true positive, true negative, false positive, and false negative values for iteration . Meanwhile, , , , are the cost-sensitive factors, where and .
-
9.
end for
-
10.
end for
-
11.
the final classifier is obtained as follows:
|