This is documentation for an old release of Scikit-learn (version 0.23). Try the latest stable release (version 1.6) or development (unstable) versions.
sklearn.metrics
.calinski_harabasz_score¶
-
sklearn.metrics.
calinski_harabasz_score
(X, labels)[source]¶ Compute the Calinski and Harabasz score.
It is also known as the Variance Ratio Criterion.
The score is defined as ratio between the within-cluster dispersion and the between-cluster dispersion.
Read more in the User Guide.
- Parameters
- Xarray-like, shape (
n_samples
,n_features
) List of
n_features
-dimensional data points. Each row corresponds to a single data point.- labelsarray-like, shape (
n_samples
,) Predicted labels for each sample.
- Xarray-like, shape (
- Returns
- scorefloat
The resulting Calinski-Harabasz score.
References