pub trait SilhouetteScore<F> {
    // Required method
    fn silhouette_score(&self) -> Result<F>;
}
Expand description

Evaluates the quality of a clustering using euclidean distance.

Required Methods§

source

fn silhouette_score(&self) -> Result<F>

Evaluates the quality of a clustering.

Given a clustered dataset, the silhouette score for each sample is computed as the relative difference between the average distance of the sample to other samples in the same cluster and the minimum average distance of the sample to samples in another cluster. This value goes from -1 to +1 when the point is respectively closer (in average) to points in another cluster and to points in its own cluster.

Finally, the silhouette score for the clustering is evaluated as the mean silhouette score of each sample.

Implementors§

source§

impl<'a, F: Float, L: 'a + Label, D: Data<Elem = F>, T: AsSingleTargets<Elem = L> + Labels<Elem = L>> SilhouetteScore<F> for DatasetBase<ArrayBase<D, Ix2>, T>