Nearest Neighbors as a hom of profunctors

Just posting this interesting paper:

TL;DR: letting N = \{1,\ldots,N\} be the discrete metric space, suppose we have data x : N \to X and classes y : N \to Y. The nearest neighbor profunctor is the pointwise hom x^{\ast} \odot 0_{N, Y} \Rightarrow x^{\ast} \odot y_{\ast} between profunctors from X to Y.

4 Likes