Optimize(knn): avoid loops to optimize distance matrix computation
Numpy is optimized to compute directly with arrays or matrixes. So we should avoid loops that slow down computation.
Numpy is optimized to compute directly with arrays or matrixes. So we should avoid loops that slow down computation.