KNN modified with cosine similarity