adding knn hw

To generalize this function, it would be best not to hardcode the number of loops for the training and test data.