org.apache.commons.math3.ml.clustering.evaluation
Class ClusterEvaluator<T extends Clusterable>
- java.lang.Object
-
- org.apache.commons.math3.ml.clustering.evaluation.ClusterEvaluator<T>
-
- Type Parameters:
T- type of the clustered points
- Direct Known Subclasses:
- SumOfClusterVariances
public abstract class ClusterEvaluator<T extends Clusterable> extends java.lang.ObjectBase class for cluster evaluation methods.- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor and Description ClusterEvaluator()Creates a new cluster evaluator with anEuclideanDistanceas distance measure.ClusterEvaluator(DistanceMeasure measure)Creates a new cluster evaluator with the given distance measure.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description booleanisBetterScore(double score1, double score2)Returns whether the first evaluation score is considered to be better than the second one by this evaluator.abstract doublescore(java.util.List<? extends Cluster<T>> clusters)Computes the evaluation score for the given list of clusters.
-
-
-
Constructor Detail
-
ClusterEvaluator
public ClusterEvaluator()
Creates a new cluster evaluator with anEuclideanDistanceas distance measure.
-
ClusterEvaluator
public ClusterEvaluator(DistanceMeasure measure)
Creates a new cluster evaluator with the given distance measure.- Parameters:
measure- the distance measure to use
-
-
Method Detail
-
score
public abstract double score(java.util.List<? extends Cluster<T>> clusters)
Computes the evaluation score for the given list of clusters.- Parameters:
clusters- the clusters to evaluate- Returns:
- the computed score
-
isBetterScore
public boolean isBetterScore(double score1, double score2)Returns whether the first evaluation score is considered to be better than the second one by this evaluator.Specific implementations shall override this method if the returned scores do not follow the same ordering, i.e. smaller score is better.
- Parameters:
score1- the first scorescore2- the second score- Returns:
trueif the first score is considered to be better,falseotherwise
-
-
DMelt 3.0 © DataMelt by jWork.ORG