Class ConcordantPairsGammaTau
- java.lang.Object
-
- elki.evaluation.clustering.internal.ConcordantPairsGammaTau
-
- All Implemented Interfaces:
elki.evaluation.Evaluator,elki.result.ResultProcessor
@Reference(authors="F. B. Baker, L. J. Hubert", title="Measuring the Power of Hierarchical Cluster Analysis", booktitle="Journal of the American Statistical Association, 70(349)", url="https://doi.org/10.1080/01621459.1975.10480256", bibkey="doi:10.1080/01621459.1975.10480256") public class ConcordantPairsGammaTau extends java.lang.Object implements elki.evaluation.EvaluatorCompute the Gamma Criterion of a data set.References:
F. B. Baker, L. J. Hubert
Measuring the Power of Hierarchical Cluster Analysis
Journal of the American Statistical Association, 70(349)Tau measures:
F. J. Rohlf
Methods of comparing classifications
Annual Review of Ecology and SystematicsThe runtime complexity of this measure is O(n*n*log(n)).
- Since:
- 0.7.0
- Author:
- Stephan Baier, Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConcordantPairsGammaTau.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description private elki.distance.PrimitiveDistance<? super elki.data.NumberVector>distanceDistance function to use.private java.lang.StringkeyKey for logging statistics.private static elki.logging.LoggingLOGLogger for debug output.private NoiseHandlingnoiseHandlingOption for noise handling.
-
Constructor Summary
Constructors Constructor Description ConcordantPairsGammaTau(elki.distance.PrimitiveDistance<? super elki.data.NumberVector> distance, NoiseHandling noiseHandling)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecomputeTau(long c, long d, double m, long wd, long bd)Compute the Tau correlation measureprotected double[]computeWithinDistances(elki.database.relation.Relation<? extends elki.data.NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, int withinPairs)protected intcountTies(double[] withinDistances, int[] withinTies)Count (and annotate) the number of tied values.doubleevaluateClustering(elki.database.relation.Relation<? extends elki.data.NumberVector> rel, Clustering<?> c)Evaluate a single clustering.voidprocessNewResult(java.lang.Object result)
-
-
-
Field Detail
-
LOG
private static final elki.logging.Logging LOG
Logger for debug output.
-
noiseHandling
private NoiseHandling noiseHandling
Option for noise handling.
-
distance
private elki.distance.PrimitiveDistance<? super elki.data.NumberVector> distance
Distance function to use.
-
key
private java.lang.String key
Key for logging statistics.
-
-
Constructor Detail
-
ConcordantPairsGammaTau
public ConcordantPairsGammaTau(elki.distance.PrimitiveDistance<? super elki.data.NumberVector> distance, NoiseHandling noiseHandling)Constructor.- Parameters:
distance- Distance functionnoiseHandling- Control noise handling
-
-
Method Detail
-
evaluateClustering
public double evaluateClustering(elki.database.relation.Relation<? extends elki.data.NumberVector> rel, Clustering<?> c)Evaluate a single clustering.- Parameters:
rel- Data relationc- Clustering- Returns:
- Gamma index
-
countTies
protected int countTies(double[] withinDistances, int[] withinTies)Count (and annotate) the number of tied values.- Parameters:
withinDistances- Distances arraywithinTies- Output array of tie counts.- Returns:
- Number of tied values.
-
computeWithinDistances
protected double[] computeWithinDistances(elki.database.relation.Relation<? extends elki.data.NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, int withinPairs)
-
computeTau
@Reference(authors="F. J. Rohlf", title="Methods of comparing classifications", booktitle="Annual Review of Ecology and Systematics", url="https://doi.org/10.1146/annurev.es.05.110174.000533", bibkey="doi:10.1146/annurev.es.05.110174.000533") public double computeTau(long c, long d, double m, long wd, long bd)Compute the Tau correlation measure- Parameters:
c- Concordant pairsd- Discordant pairsm- Total number of pairswd- Number of within distancesbd- Number of between distances- Returns:
- Gamma plus statistic
-
processNewResult
public void processNewResult(java.lang.Object result)
- Specified by:
processNewResultin interfaceelki.result.ResultProcessor
-
-