Base class

Base class for diversity based subset selection.

class selector.base.SelectionBase

Base class for selecting subset of sample points.

select(X: numpy.ndarray, size: int, labels: Optional[numpy.ndarray] = None) numpy.ndarray

Return indices representing subset of sample points.

X: ndarray of shape (n_samples, n_features) or (n_samples, n_samples)

Feature matrix of n_samples samples in n_features dimensional feature space. If fun_distance is None, this X is treated as a square pairwise distance matrix.

size: int

Number of sample points to select (i.e. size of the subset).

labels: np.ndarray, optional

Array of integers or strings representing the labels of the clusters that each sample belongs to. If None, the samples are treated as one cluster. If labels are provided, selection is made from each cluster.

selected: list

Indices of the selected sample points.

abstract select_from_cluster(X: numpy.ndarray, size: int, labels: Optional[numpy.ndarray] = None) numpy.ndarray

Return indices representing subset of sample points from one cluster.

X: ndarray of shape (n_samples, n_features) or (n_samples, n_samples)

Feature matrix of n_samples samples in n_features dimensional feature space. If fun_distance is None, this X is treated as a square pairwise distance matrix.

size: int

Number of sample points to select (i.e. size of the subset).

labels: np.ndarray, optional

Array of integers or strings representing the labels of the clusters that each sample belongs to. If None, the samples are treated as one cluster. If labels are provided, selection is made from each cluster.

selected: list

Indices of the selected sample points.