Fixed knn and test method