Silhouette
Mean Silhouette Coefficient over all clustered samples.
Silhouette measures how similar each sample is to samples in its own cluster compared with samples in the nearest different cluster. Values close to 1 indicate compact and well-separated clusters, values near 0 indicate overlapping clusters, and negative values suggest that samples may have been assigned to the wrong cluster.
Range: [-1, 1], higher is better (MAXIMIZE = True).
References
- [1] Rousseeuw, P. J. (1987). "Silhouettes: A graphical aid to the interpretation and validation of cluster analysis." Journal of Computational and Applied Mathematics, 20, 53-65.
- [2] https://scikit-learn.org/stable/modules/generated/sklearn.metrics.silhouette_score.html
Methods
score(x: 'DashAIDataset | pd.DataFrame', labels: 'np.ndarray | list') -> float | None
SilhouetteCalculate the Silhouette score for clustering assignments.
Parameters
- x : DashAIDataset or pandas.DataFrame
- Feature data used by the clustering model.
- labels : np.ndarray or list
- Cluster labels assigned to each sample.
Returns
- float | None
- Silhouette score, or
Nonewhen the score is not defined for the current label distribution.
get_metadata(cls: 'BaseMetric') -> Dict[str, Any]
BaseMetricGet metadata values for the current metric.
Returns
- Dict[str, Any]
- Dictionary with the metadata
get_registry(cls) -> Dict[str, Type[ForwardRef('ClusteringMetric')]]
ClusteringMetricReturn concrete clustering metric classes keyed by class name.