|
Algorithm 2: Bagging classifier algorithm. |
Input: KDD99 and NSLKDD datasets Training:
Selection of the number of samples for Bagging which is n samples and also the selection of base classifier C (j48, Random Forest, and reptree in our case).
Dividing dataset into two subsets (Training and Testing subsets). Produce further training datasets using with replacement sampling and these datasets are .
Then, train a base classifier on each dataset and build n number of classifiers .
Testing:
In the testing dataset, each data object X is passed to trained classifiers .
The label is assigned to every new data object based on a majority vote. For the classification problem, the majority vote is used to assign a new label to data point X and, for the regression problem, the average value is used to be assigned to a new data object .
We repeat these steps until we classify every object in the dataset.
|