Let $P$ be a set of $n$ colored points. We develop efficient data structures that store $P$ and can answer chromatic $k$-nearest neighbor ($k$-NN) queries. Such a query consists of a query point $q$ and a number $k$, and asks for the color that appears most frequently among the $k$ points in $P$ closest to $q$. Answering such queries efficiently is the key to obtain fast $k$-NN classifiers. Our main aim is to obtain query times that are independent of $k$ while using near-linear space. We show that this is possible using a combination of two data structures. The first data structure allow us to compute a region containing exactly the $k$-nearest neighbors of a query point $q$, and the second data structure can then report the most frequent color in such a region. This leads to linear space data structures with query times of $O(n^{1 / 2} \log n)$ for points in $\mathbb{R}^1$, and with query times varying between $O(n^{2/3}\log^{2/3} n)$ and $O(n^{5/6} {\rm polylog} n)$, depending on the distance measure used, for points in $\mathbb{R}^2$. Since these query times are still fairly large we also consider approximations. If we are allowed to report a color that appears at least $(1-\varepsilon)f^*$ times, where $f^*$ is the frequency of the most frequent color, we obtain a query time of $O(\log n + \log\log_{\frac{1}{1-\varepsilon}} n)$ in $\mathbb{R}^1$ and expected query times ranging between $\tilde{O}(n^{1/2}\varepsilon^{-3/2})$ and $\tilde{O}(n^{1/2}\varepsilon^{-5/2})$ in $\mathbb{R}^2$ using near-linear space (ignoring polylogarithmic factors).
翻译:Lets P$ 是一组 $1 的彩色点 。 我们开发高效的数据结构, 存储 $3 美元, 并可以解答 nrocal $1 美元最近的邻居( k$- NN) 查询 。 这种查询由查询点 $ 和 $ 美元 组成, 并询问最经常出现在美元最接近 $ 美元 的 美元点中的颜色 。 回答这类查询是获取快速 $1 美元 美元 =NNN 分解器的关键 。 我们的主要目的是在使用近线空间 $2 美元的情况下获取独立于 $k$ 的查询次数。 我们显示, 使用两个数据结构的组合是 $ 。 第一个数据结构允许我们计算一个完全包含 $k 美元最接近的邻居 $ $ 美元 美元, 而第二个数据结构可以在此区域中报告最频繁的颜色 。 这导致直线空间数据结构的查询次数为 $( n=1 / ⁇ } ⁇ ⁇ = 美元 美元 美元 。