pyFM.spectral.nearest_neighbor¶
Nearest-neighbour queries for the NumPy backend.
A kd-tree is the right tool at low dims only
from pyFM.spectral.nearest_neighbor import knn_query, set_config
matches = knn_query(X, Y) # backend chosen automatically matches = knn_query(X, Y, method=”brute”) # or forced set_config(kdtree_max_dim=12) # or retuned
Functions
|
Nearest neighbours by brute force. |
|
Pick the backend for a query of n_keys reference points in dim dimensions. |
|
Pairwise squared Euclidean distance matrix between two sets of points X and Y. |
|
Return the current configuration, or value of specific key |
|
Query the k nearest neighbours in X of each point of Y. |
Restore every threshold to its default. |
|
|
Override one or more thresholds. |
|
Nearest neighbours via a kd-tree. |