Define the set of K-Nearest-Neighbors.

84 Views Asked by At

Say i have a set $X=\{x_i|i\in[N]\}$ (where $[N]=\{i\in\mathbf N|0<i\le N\}$) and a metric $d(x,y)$ (distance). $x$ and $y$ could be in euclidean space for example and either be part of $X$ themselves or not.
The set of all neighboring relations between all pairs of points $x$ and $x_i\in X$ has an ordering and can be an "ordered set" (I dont know much about that).

1) How do I define such an ordered set?
2) How would I define the set of $k$ nearest neighbors to a point $x$, lets call it $\mathbf{N}^k(x)$

This set contains points from $X$, namely the first $k$ points with the smallest distance to the point $x$ (including $x$ itself if $x\in X$).
I was thinking to answer question 2) by somehow constructing a set of "first $k$ elements" from the ordered set and go from there. I dont know if this is very elegant though.

1

There are 1 best solutions below

2
On

The points of a finite metric space can be given
any order as well as the pairs of neighborhoods.
The k nearest points to x is ambiguous. For example,
with the metric d(x,y) = 1 for all distinct x,y in X, the
set of the 2 nearest points to x is {x,y} for any y /= x.

Whence this problem? It is jumbled. Is X embedded in a
space? If so, what is it? If X = {1,2,3} is embedded into
R and neighbors can be outside X, then there are no nearest
neighbors of x other than x.