Add cross validation to KNN algorithm