Package elki.clustering.kmeans.quality
Class WithinClusterMeanDistance
- java.lang.Object
-
- elki.clustering.kmeans.quality.WithinClusterMeanDistance
-
- All Implemented Interfaces:
KMeansQualityMeasure<NumberVector>
public class WithinClusterMeanDistance extends java.lang.Object implements KMeansQualityMeasure<NumberVector>
Class for computing the average overall distance.The average of all average pairwise distances in a cluster.
- Since:
- 0.6.0
- Author:
- Stephan Baier
-
-
Constructor Summary
Constructors Constructor Description WithinClusterMeanDistance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isBetter(double currentCost, double bestCost)
Compare two scores.<V extends NumberVector>
doublequality(Clustering<? extends MeanModel> clustering, NumberVectorDistance<? super V> distance, Relation<V> relation)
Calculates and returns the quality measure.
-
-
-
Method Detail
-
quality
public <V extends NumberVector> double quality(Clustering<? extends MeanModel> clustering, NumberVectorDistance<? super V> distance, Relation<V> relation)
Description copied from interface:KMeansQualityMeasure
Calculates and returns the quality measure.- Specified by:
quality
in interfaceKMeansQualityMeasure<NumberVector>
- Type Parameters:
V
- Actual vector type (could be a subtype of O!)- Parameters:
clustering
- Clustering to analyzedistance
- Distance function to use (usually Euclidean or squared Euclidean!)relation
- Relation for accessing objects- Returns:
- quality measure
-
isBetter
public boolean isBetter(double currentCost, double bestCost)
Description copied from interface:KMeansQualityMeasure
Compare two scores.- Specified by:
isBetter
in interfaceKMeansQualityMeasure<NumberVector>
- Parameters:
currentCost
- New (candiate) cost/scorebestCost
- Existing best cost/score (may beNaN
)- Returns:
true
when the new score is better, or the old score isNaN
.
-
-