Python notebooks for kNN Tutorial paper available here https://arxiv.org/abs/2004.04523:
kNN-Basic: Code for a basic k-NN classifier inscikit-learn.kNN-Correlation: How to use correlation as the k-NN metricscikit-learn.kNN-Cosine: How to use Cosine as the k-NN metric inscikit-learn. Using Cosine similarity for text classification.kNN-DTW: Using thetslearnlibrary for time-series classification using DTW.kNN-MetricLearn: Using themetric-learnlibrary to learn a similarity metric.kNN-Speedup: Testing thescikit-learnspeedup mechanisms (kd_treeandball_tree) on four datasets. Requires the four datasets and apyfilekNNDataLoader.pyto run (all available in this repo).kNN-Annoy: Testing the impact of usingannoyfor speedup.annoyprovides code for Approximate Nearest Neighbour that may not be as accurate as full k-NN. RequireskNNAnnoy.pythat contains some wrapper code forannoy. Also requires the four datasets and apyfilekNNDataLoader.pyto run (all available in this repo).kNN-PCA: Some code to use PCA to estimate the intrinsic dimension of the four datasets. RequireskNNDataLoader.pyand the data files.kNN-InstSel: An assessment of two instance selection algorithms (CNN and CRR) on three datasets. RequireskNNEdit.pythat containst basic implementations of the two algorithms. RequireskNNDataLoader.pyand the data files.kNN-Model-Selection: Usinggrid-searchfor model selection (hyper-parameter tuning).