Class SumOfClusterVariances
- java.lang.Object
-
- org.apache.commons.math4.legacy.ml.clustering.evaluation.SumOfClusterVariances
-
- All Implemented Interfaces:
ClusterEvaluator
public class SumOfClusterVariances extends Object implements ClusterEvaluator
Computes the sum of intra-cluster distance variances according to the formula:\( score = \sum\limits_{i=1}^n \sigma_i^2 \)
where n is the number of clusters and \( \sigma_i^2 \) is the variance of intra-cluster distances of cluster \( c_i \).- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description SumOfClusterVariances(DistanceMeasure measure)
-
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
-
SumOfClusterVariances
public SumOfClusterVariances(DistanceMeasure measure)
- Parameters:
measure
- Distance measure.
-
-
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
.
-
-