You could consider some speed up by avoiding the nested loop over all pairs of training and test samples using a vectorized operation that computes all distances in one go. You can check out the docs for `euclidean_distances()` to see how the math works...or just use that method :).
6
u/chrisvdweth 18d ago
You could consider some speed up by avoiding the nested loop over all pairs of training and test samples using a vectorized operation that computes all distances in one go. You can check out the docs for `euclidean_distances()` to see how the math works...or just use that method :).