Package elki.clustering.kmeans.quality
Interface KMeansQualityMeasure<O extends NumberVector>
-
- Type Parameters:
O
- Input Object restriction type
- All Known Implementing Classes:
AbstractKMeansQualityMeasure
,AkaikeInformationCriterion
,AkaikeInformationCriterionXMeans
,BayesianInformationCriterion
,BayesianInformationCriterionXMeans
,BayesianInformationCriterionZhao
,WithinClusterMeanDistance
,WithinClusterVariance
public interface KMeansQualityMeasure<O extends NumberVector>
Interface for computing the quality of a K-Means clustering.Important note: some measures are ascending, others are descending, so use the method
isBetter(double, double)
for ordering.- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isBetter(double currentCost, double bestCost)
Compare two scores.<V extends O>
doublequality(Clustering<? extends MeanModel> clustering, NumberVectorDistance<? super V> distance, Relation<V> relation)
Calculates and returns the quality measure.
-
-
-
Method Detail
-
quality
<V extends O> double quality(Clustering<? extends MeanModel> clustering, NumberVectorDistance<? super V> distance, Relation<V> relation)
Calculates and returns the quality measure.- 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
boolean isBetter(double currentCost, double bestCost)
Compare two scores.- 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
.
-
-