KNN classification with one step computation