Loading K-nearest neighbors algorithm