| Algorithm 4: The K-NN Algorithm |
| 1: Classify . |
| 2: for to n do |
| 3: Calculate the Euclidean distance . |
| 4: end. |
| 5: Compute set I having the indices for the k smallest distances . |
| 6: Return majority label for where . |
| Algorithm 4: The K-NN Algorithm |
| 1: Classify . |
| 2: for to n do |
| 3: Calculate the Euclidean distance . |
| 4: end. |
| 5: Compute set I having the indices for the k smallest distances . |
| 6: Return majority label for where . |