compute_exemplar_indices

PLSCAN.compute_exemplar_indices(labels=None)

Return the exemplar point indices for each cluster.

For each leaf-cluster segment, exemplars are the points whose dropout distance in the condensed tree equals the segment’s minimum distance – the densest points within that segment.

Parameters:

labels (ndarray[tuple[int], dtype[int_]] | None, default: None) – An optional integer array of shape (n_samples,) with cluster labels for each point. When None (default), the fitted labels_ are used. Labels must be dense and zero-indexed (cluster labels are 0, 1, ..., n_clusters - 1), with -1 for noise points.

Return type:

list[ndarray]

Returns:

exemplars_per_cluster – A list of length n_clusters. Each entry is an integer array of point indices that are exemplars for the corresponding cluster. Returns an empty list when no clusters exist (all noise).

Raises:
  • NotFittedError – If the estimator has not been fitted yet.

  • ValueError – If the shape of labels does not match the number of samples.