I'm looking for a good way to partition a large, fairly high-dimensional dataset in order to perform fast kNN searches not just in the full $N$-dimensional space, but also in lower-dimensional subspaces of that space.
For example, consider a point $p$ in a 3-dimensional space, $\{X, Y, Z\}$. On the one hand, I want to find its nearest neighbour $i$:
$$ \DeclareMathOperator*{\argmin}{argmin} \argmin_{i} max{\{\| x_p - x_i \|, \|y_p - y_i\|, \|z_p - z_i\| }\} $$
But I also want to be able to efficiently find the nearest neighbour $j$ in the $\{X, Y\}$ subspace, i.e.:
$$ \DeclareMathOperator*{\argmin}{argmin} \argmin_{j} max{\{\| x_p - x_j \|, \|y_p - y_j\|}\} $$
In my case there are usually many more than 3 dimensions, and I want to be able to find the $k^{th}$ nearest neighbour distances considering multiple different subsets of those dimensions.
To give you some more background, my goal is to use kNN distances to estimate conditional mutual information from continuous data without having to discretize it and compute histograms.
What would be an appropriate way to partition my data?
Some more information:
- My dimensionality will vary between about 3 and 30
- The number of datapoints will probably be on the order of about 200000