silhouette_score
Module: strata.metrics • Kind: function
Source: strata/metrics/cluster.mojo
def silhouette_score[dtype: DType = DType.float64]( X: Matrix[dtype], labels: List[Int],) -> Float64from strata.metrics import silhouette_scoreCompute the mean Silhouette Coefficient of all samples.
where is the mean intra-cluster distance and is the mean nearest-cluster distance. Samples alone in their cluster score 0.0.
Returns: Float64 — Float64: Mean Silhouette Coefficient between -1.0 and 1.0.