Skip to main content

CalinskiHarabasz

Metric
DashAI.back.metrics.clustering.CalinskiHarabasz

Ratio between inter-cluster and intra-cluster dispersion.

Calinski-Harabasz evaluates how dense and well-separated clusters are by comparing dispersion between clusters with dispersion within clusters. Higher values generally indicate better-defined clusters.

Range: [0, +inf), higher is better (MAXIMIZE = True).

References​

Methods​

score(x: 'DashAIDataset | pd.DataFrame', labels: 'np.ndarray | list') -> float | None

Defined on CalinskiHarabasz

Calculate the Calinski-Harabasz 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
Calinski-Harabasz score, or None when the score is not defined for the current label distribution.

get_metadata(cls: 'BaseMetric') -> Dict[str, Any]

Defined on BaseMetric

Get metadata values for the current metric.

Returns

Dict[str, Any]
Dictionary with the metadata

get_registry(cls) -> Dict[str, Type[ForwardRef('ClusteringMetric')]]

Defined on ClusteringMetric

Return concrete clustering metric classes keyed by class name.

Compatible with​