Trait linfa::metrics::SilhouetteScore
source · pub trait SilhouetteScore<F> {
fn silhouette_score(&self) -> Result<F>;
}
Expand description
Evaluates the quality of a clustering using euclidean distance.
Required Methods§
sourcefn silhouette_score(&self) -> Result<F>
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.