Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.metrics`.calinski_harabasz_score

sklearn.metrics.calinski_harabasz_score(X, labels)

  Compute the Calinski and Harabasz score.

  It is also known as the Variance Ratio Criterion.

  The score is defined as ratio of the sum of between-cluster dispersion and of within-cluster dispersion.

  Read more in the User Guide.

  Parameters:
    X array-like of shape (n_samples, n_features)

      A list of `n_features`-dimensional data points. Each row corresponds to a single data point.

    labels array-like of shape (n_samples,)

      Predicted labels for each sample.

  Returns:
    score float

      The resulting Calinski-Harabasz score.

  References

  [1]

  T. Calinski and J. Harabasz, 1974. “A dendrite method for cluster analysis”. Communications in Statistics