Class 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.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
    • 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 elki.distance.PrimitiveDistance<? super elki.data.NumberVector> distance
      Distance function to use.
      private java.lang.String key
      Key for logging statistics.
      private static elki.logging.Logging LOG
      Logger for debug output.
      private NoiseHandling noiseHandling
      Option 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
      double computeTau​(long c, long d, double m, long wd, long bd)
      Compute the Tau correlation measure
      protected double[] computeWithinDistances​(elki.database.relation.Relation<? extends elki.data.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​(elki.database.relation.Relation<? extends elki.data.NumberVector> rel, Clustering<?> c)
      Evaluate a single clustering.
      void processNewResult​(java.lang.Object result)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 function
        noiseHandling - 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 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​(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 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)
        Specified by:
        processNewResult in interface elki.result.ResultProcessor