Hi,
    For machine learning centroid cluster algorithm, we often use is 
Calinsk-iHarabasz score to evaluate which algorithm or how many centers is best 
for a dataset.
    The python lib sklearn implements Calinsk-iHarabasz as 
sklearn.metrics.calinski_harabasz_score.

I think there should be a CalinskiHarabaszClusterEvaluator in commons math:
```java
package org.apache.commons.math4.ml.clustering.evaluation;

import org.apache.commons.math4.ml.clustering.Cluster;
import org.apache.commons.math4.ml.clustering.Clusterable;

import java.util.List;

public class CalinskiHarabaszClusterEvaluator<T extends Clusterable> extends 
ClusterEvaluator<T> {
    @Override
    public double score(List<? extends Cluster<T>> clusters) {
        //TODO: Implement the Calinski-Harabasz Score algorithm
        return 0;
    }

    @Override
    public boolean isBetterScore(double score1, double score2) {
        return score1 > score2;
    }
}
```

The code can be implemented by read the algorithm documents,
or translate from python sklearn.metrics.calinski_harabasz_score.

Reply via email to