Class ConcordantPairsGammaTau
- java.lang.Object
-
- elki.evaluation.clustering.internal.ConcordantPairsGammaTau
-
- All Implemented Interfaces:
Evaluator
,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 Evaluator
Compute 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 class
ConcordantPairsGammaTau.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description private PrimitiveDistance<? super NumberVector>
distance
Distance function to use.private java.lang.String
key
Key for logging statistics.private static Logging
LOG
Logger for debug output.private NoiseHandling
noiseHandling
Option for noise handling.
-
Constructor Summary
Constructors Constructor Description ConcordantPairsGammaTau(PrimitiveDistance<? super NumberVector> distance, NoiseHandling noiseHandling)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
computeTau(long c, long d, double m, long wd, long bd)
Compute the Tau correlation measureprotected double[]
computeWithinDistances(Relation<? extends NumberVector> rel, java.util.List<? extends Cluster<?>> clusters, int withinPairs)
protected int
countTies(double[] withinDistances, int[] withinTies)
Count (and annotate) the number of tied values.double
evaluateClustering(Relation<? extends NumberVector> rel, Clustering<?> c)
Evaluate a single clustering.void
processNewResult(java.lang.Object result)
Process a result.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Logger for debug output.
-
noiseHandling
private NoiseHandling noiseHandling
Option for noise handling.
-
distance
private PrimitiveDistance<? super NumberVector> distance
Distance function to use.
-
key
private java.lang.String key
Key for logging statistics.
-
-
Constructor Detail
-
ConcordantPairsGammaTau
public ConcordantPairsGammaTau(PrimitiveDistance<? super NumberVector> distance, NoiseHandling noiseHandling)
Constructor.- Parameters:
distance
- Distance functionnoiseHandling
- Control noise handling
-
-
Method Detail
-
evaluateClustering
public double evaluateClustering(Relation<? extends 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(Relation<? extends 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)
Description copied from interface:ResultProcessor
Process a result.- Specified by:
processNewResult
in interfaceResultProcessor
- Parameters:
result
- Newly added result subtree.
-
-