Class MaximumConditionalEntropy

  • All Implemented Interfaces:
    Dependence

    @Reference(authors="D. Guo",
               title="Coordinating computational and visual approaches for interactive feature selection and multivariate clustering",
               booktitle="Information Visualization, 2(4)",
               url="https://doi.org/10.1057/palgrave.ivs.9500053",
               bibkey="DBLP:journals/ivs/Guo03")
    public class MaximumConditionalEntropy
    extends java.lang.Object
    implements Dependence
    Compute a mutual information based dependence measure using a nested means discretization, originally proposed for ordering axes in parallel coordinate plots.

    Reference:

    D. Guo
    Coordinating computational and visual approaches for interactive feature selection and multivariate clustering
    Information Visualization, 2(4), 2003.

    Since:
    0.7.0
    Author:
    Erich Schubert
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private <A> java.util.ArrayList<int[]> buildPartitions​(NumberArrayAdapter<?,​A> adapter1, A data1, int len, int depth)
      Partitions an attribute.
      <A,​B>
      double
      dependence​(NumberArrayAdapter<?,​A> adapter1, A data1, NumberArrayAdapter<?,​B> adapter2, B data2)
      Measure the dependence of two variables.
      private void divide​(int[] idx, double[] data, java.util.ArrayList<int[]> ret, int start, int end, int depth)
      Recursive call to further subdivide the array.
      private double getMCEntropy​(int[][] mat, java.util.ArrayList<int[]> partsx, java.util.ArrayList<int[]> partsy, int size, int gridsize, double loggrid)
      Compute the MCE entropy value.
      private void intersectionMatrix​(int[][] res, java.util.ArrayList<int[]> partsx, java.util.ArrayList<int[]> partsy, int gridsize)
      Intersect the two 1d grid decompositions, to obtain a 2d matrix.
      private int intersectionSize​(int[] px, int[] py)
      Compute the intersection of two sorted integer lists.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TARGET

        public static final int TARGET
        Desired size: 35 observations. While this could trivially be made parameterizable, it is a reasonable rule of thumb and not expected to have a major effect.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MaximumConditionalEntropy

        public MaximumConditionalEntropy()
    • Method Detail

      • dependence

        public <A,​B> double dependence​(NumberArrayAdapter<?,​A> adapter1,
                                             A data1,
                                             NumberArrayAdapter<?,​B> adapter2,
                                             B data2)
        Description copied from interface: Dependence
        Measure the dependence of two variables.

        This is the more flexible API, which allows using different internal data representations.

        Specified by:
        dependence in interface Dependence
        Type Parameters:
        A - First array type
        B - Second array type
        Parameters:
        adapter1 - First data adapter
        data1 - First data set
        adapter2 - Second data adapter
        data2 - Second data set
        Returns:
        Dependence measure
      • buildPartitions

        private <A> java.util.ArrayList<int[]> buildPartitions​(NumberArrayAdapter<?,​A> adapter1,
                                                               A data1,
                                                               int len,
                                                               int depth)
        Partitions an attribute.
        Parameters:
        adapter1 - Data adapter
        data1 - Data set
        len - Length of data
        depth - Splitting depth
        Returns:
        List of sorted objects
      • divide

        private void divide​(int[] idx,
                            double[] data,
                            java.util.ArrayList<int[]> ret,
                            int start,
                            int end,
                            int depth)
        Recursive call to further subdivide the array.
        Parameters:
        idx - Object indexes.
        data - 1D data, sorted
        ret - Output index
        start - Interval start
        end - Interval end
        depth - Depth
      • intersectionMatrix

        private void intersectionMatrix​(int[][] res,
                                        java.util.ArrayList<int[]> partsx,
                                        java.util.ArrayList<int[]> partsy,
                                        int gridsize)
        Intersect the two 1d grid decompositions, to obtain a 2d matrix.
        Parameters:
        res - Output matrix to fill
        partsx - Partitions in first component
        partsy - Partitions in second component.
        gridsize - Size of partition decomposition
      • intersectionSize

        private int intersectionSize​(int[] px,
                                     int[] py)
        Compute the intersection of two sorted integer lists.
        Parameters:
        px - First list
        py - Second list
        Returns:
        Intersection size.
      • getMCEntropy

        private double getMCEntropy​(int[][] mat,
                                    java.util.ArrayList<int[]> partsx,
                                    java.util.ArrayList<int[]> partsy,
                                    int size,
                                    int gridsize,
                                    double loggrid)
        Compute the MCE entropy value.
        Parameters:
        mat - Partition size matrix
        partsx - Partitions on X
        partsy - Partitions on Y
        size - Data set size
        gridsize - Size of grids
        loggrid - Logarithm of grid sizes, for normalization
        Returns:
        MCE score.