da_fps_np

This function implements the Density Aware Farthest Point Sampling (DAFPS) algorithm using the numpy library. DAFPS selects a subset of points from a dataset by iteratively choosing the point that is farthest from the current set of selected points, while also considering the density of points in the neighborhood of each selected point.

Parameters:

Xnumpy.ndarray (n_samples, n_features)

Input points, representing a set of data points.

initializationlist

List of indices (rows of the input points matrix) representing the initial set of selected elements.

bint

The desired number of points to select.

dnumpy.ndarray (n_samples, knn), optional (default=None)

Distance matrix or array of distances between points. If None, it is computed using the Euclidean distance.

distance_funccallable, optional (default=None)

A function to compute pairwise distances. If None, Euclidean distance is used.

precomputed_distancesbool, optional (default=False)

If True, the input X is assumed to be a precomputed distance matrix.

weightsnumpy.ndarray (n_samples, ), optional (default=None)

Array of weights for each point. If provided, these weights are used to adjust the selection process.

verbosebool, optional (default=False)

If True, progress messages are printed.

Returns:

centerslist

List of indices representing the selected points using the DA-FPS algorithm.