|
Algorithm 3: Adaboost classifier algorithm |
Input: KDD99 and nslkdd datasets Training:
Selection of base classifier C;
Set the threshold for initial weights [0, 1], = 1, Commonly ;
For n = 1 →k produce sample
for training from D using the distribution
Training of base classifier C on data subset to develop the classifier.
is the ensemble error calculated when classifier misclassifies the data point in D.
If (0, 0.5) then calculate and update the next weight.
Distribution needs to be normalized.
For further value of , set threshold and continue the process;
Return the trained classifiers and .
Testing:
In the testing dataset, each data object X is passed to the testing dataset; classify by classifiers .
For each label y, assign to x by , calculate . The class that has maximum value is decided as the class label of x.
Repeat step2 for testing data and return the output.
|