The standard way of computing the k-nearest neighbors is as follows.
Initialize a
aoclda.neighbors.nearest_neighbors()object with options set in the class constructor.Fit the k-NN for your training data set using
aoclda.neighbors.nearest_neighbors.fit().Compute the indices of the nearest neighbors and optionally the corresponding distances using
aoclda.neighbors.nearest_neighbors.kneighbors().
Initialize a
da_handlewithda_handle_typeda_handle_nn.Pass data to the handle using da_nn_set_data_?.
Compute the indices of the nearest neighbors and optionally the corresponding distances using da_nn_kneighbors_?.