Contents
Compute k-nearest neighbors of locations.
locations (np.ndarray of shape (n_samples, 2)) – Data matrix
n_neighbors (int) – Number of nearest neighbors
method (str, default='kd_tree') – Method to use when computing the nearest neighbors, one of [‘ball_tree’, ‘kd_tree’, ‘brute’]
knn_indices (np.ndarray of shape (n_samples, n_neighbors)) – Each row represents the knn of that sample