Class LogDiscretizer

    • Constructor Summary

      Constructors 
      Constructor Description
      LogDiscretizer​(double base)
      Creates a new discretizer.
      LogDiscretizer​(double base, double upperBound)
      Creates a new discretizer where values greater than upperBound are rounded down to upperBound.
      LogDiscretizer​(double base, double upperBound, double lowerBound)
      Creates a new discretizer where values greater than upperBound are rounded down to upperBound and values less than lowerBound are rounded up to lowerBound.
    • Constructor Detail

      • LogDiscretizer

        public LogDiscretizer​(double base)
        Creates a new discretizer. Values less than 1 are rounded up to 1.
        Parameters:
        base - the base of the logarithm
      • LogDiscretizer

        public LogDiscretizer​(double base,
                              double upperBound)
        Creates a new discretizer where values greater than upperBound are rounded down to upperBound. Values less than 1 are rounded up to 1.
        Parameters:
        base - the base of the logarithm
        upperBound - the upper bound
      • LogDiscretizer

        public LogDiscretizer​(double base,
                              double upperBound,
                              double lowerBound)
        Creates a new discretizer where values greater than upperBound are rounded down to upperBound and values less than lowerBound are rounded up to lowerBound.
        Parameters:
        base - the base of the logarithm
        upperBound - the upper bound
        lowerBound - the lower bound
    • Method Detail

      • discretize

        public double discretize​(double value)
        Description copied from interface: Discretizer
        Returns the bin's value of which value is associated to.
        Specified by:
        discretize in interface Discretizer
        Parameters:
        value - a value
        Returns:
        the bin's value
      • binWidth

        public double binWidth​(double value)
        Description copied from interface: Discretizer
        Returns the bin's width of which value is associated to.
        Specified by:
        binWidth in interface Discretizer
        Parameters:
        value - a value
        Returns:
        the width of the bin of value. The width of the 0-th bin is 1.
      • index

        public int index​(double value)
        Description copied from interface: Discretizer
        Returns the bin's index of which values is associated to.
        Specified by:
        index in interface Discretizer
        Parameters:
        value - the value to discretize
        Returns:
        the index of the bin