Class CalinskiHarabasz
- java.lang.Object
-
- org.apache.commons.math4.legacy.ml.clustering.evaluation.CalinskiHarabasz
-
- All Implemented Interfaces:
ClusterEvaluator
public class CalinskiHarabasz extends Object implements ClusterEvaluator
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.
- See Also:
- A dendrite method for cluster analysis
-
-
Constructor Summary
Constructors Constructor Description CalinskiHarabasz()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isBetterScore(double a, double b)
Provides a means to interpret thescore value
.double
score(List<? extends Cluster<? extends Clusterable>> clusters)
-
-
-
Constructor Detail
-
CalinskiHarabasz
public CalinskiHarabasz()
-
-
Method Detail
-
score
public double score(List<? extends Cluster<? extends Clusterable>> clusters)
- Specified by:
score
in interfaceClusterEvaluator
- Parameters:
clusters
- List of clusters.- Returns:
- the score attributed by the evaluator.
-
isBetterScore
public boolean isBetterScore(double a, double b)
Provides a means to interpret thescore value
.- Specified by:
isBetterScore
in interfaceClusterEvaluator
- Parameters:
a
- Score computed by this evaluator.b
- Score computed by this evaluator.- Returns:
true
if the evaluator considers that scorea
is better than scoreb
.
-
-