dunn_index

Function dunn_index 

Source
pub fn dunn_index<F, S1, S2, D>(
    x: &ArrayBase<S1, Ix2>,
    labels: &ArrayBase<S2, D>,
) -> Result<F>
where F: Float + NumCast + Debug + 'static, S1: Data<Elem = F>, S2: Data<Elem = usize>, D: Dimension,
Expand description

Calculates the Dunn index for a clustering

The Dunn index is the ratio of the minimum inter-cluster distance to the maximum intra-cluster distance. Higher values indicate better clustering.

§Arguments

  • x - Array of shape (n_samples, n_features) - The data
  • labels - Array of shape (n_samples,) - Predicted labels for each sample

§Returns

  • The Dunn index