Class 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 Systematics

    The runtime complexity of this measure is O(n*n*log(n)).

    Since:
    0.7.0
    Author:
    Stephan Baier, Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        Logger for debug output.
      • noiseHandling

        private NoiseHandling noiseHandling
        Option for noise handling.
      • 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 function
        noiseHandling - Control noise handling
    • Method Detail

      • evaluateClustering

        public double evaluateClustering​(Relation<? extends NumberVector> rel,
                                         Clustering<?> c)
        Evaluate a single clustering.
        Parameters:
        rel - Data relation
        c - Clustering
        Returns:
        Gamma index
      • countTies

        protected int countTies​(double[] withinDistances,
                                int[] withinTies)
        Count (and annotate) the number of tied values.
        Parameters:
        withinDistances - Distances array
        withinTies - 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 pairs
        d - Discordant pairs
        m - Total number of pairs
        wd - Number of within distances
        bd - 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 interface ResultProcessor
        Parameters:
        result - Newly added result subtree.