| Algorithm 2 Pseudo code for K-nearest neighbors training |
|
Require: Initialize Require: Initialize =[] Train first weak decision tree model for Each observation do = euclidean distance calculate euclidean distance append neighbors end for pick the top-K closest training data take the most common label of these labels return labels |