dataeval.core.compute_neighbor_distances

dataeval.core.compute_neighbor_distances(data, k=10)

Compute k nearest neighbors for each point in data (self-query, excluding self).

Parameters:
data : NDArray

Input data array with shape (n_samples, n_features)

k : int, default=10

Number of neighbors to find (excluding self)

Returns:

  • neighbors (NDArray[np.int32]) – Indices of k nearest neighbors for each point with shape (n_samples, k)

  • distances (NDArray[np.float32]) – Distances to k nearest neighbors for each point with shape (n_samples, k)

Return type:

tuple[numpy.typing.NDArray[numpy.int32], numpy.typing.NDArray[numpy.float32]]

See also

compute_neighbors

For querying neighbors between two different datasets