DaviesBouldin
DashAI.back.metrics.clustering.DaviesBouldin
Average similarity between each cluster and its closest cluster.
Davies-Bouldin compares within-cluster dispersion with separation between clusters. Lower values indicate that clusters are compact and far from one another. A value of 0 is ideal, though uncommon in real datasets.
Range: [0, +inf), lower is better (MAXIMIZE = False).
References
- [1] Davies, D. L. & Bouldin, D. W. (1979). "A Cluster Separation Measure." IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-1(2), 224-227.
- [2] https://scikit-learn.org/stable/modules/generated/sklearn.metrics.davies_bouldin_score.html
Methods
score(x: 'DashAIDataset | pd.DataFrame', labels: 'np.ndarray | list') -> float | None
DaviesBouldinCalculate the Davies-Bouldin 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
- Davies-Bouldin 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.