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. WhenNone(default), the fittedlabels_are used. Labels must be dense and zero-indexed (cluster labels are0, 1, ..., n_clusters - 1), with-1for noise points.- Return type:
- 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
labelsdoes not match the number of samples.