Trait linfa::metrics::SilhouetteScore[][src]

pub trait SilhouetteScore<F> {
    fn silhouette_score(&self) -> Result<F>;
}

Evaluates the quality of a clustering using euclidean distance.

Required methods

fn silhouette_score(&self) -> Result<F>[src]

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.

Loading content...

Implementors

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

Loading content...