This is my first attempt at writing Mathematica code but I am getting strange results which are probably due to some bug I cannot detect.
This code creates a test set with 2 classes and size 1000 from a Bivariate Gaussian distribution then creates 6 training sets with 2 classes and sizes 10^i, i = 1..6.
Then I run the Nearest neighbor algorithm on each train set and test set and compute the error rate.
However, as you can see from the table at the end, I get error rates that don't make much sense. I might as well flip a coin instead of running the algorithm. Unfortunately I cannot spot the bug in the code.