Documentation of 'com.flaptor.hist4j.AdaptiveHistogram' Java class
AdaptiveHistogram
com.flaptor.hist4j

Class AdaptiveHistogram

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    H1DA


    public class AdaptiveHistogram
    extends java.lang.Object
    implements java.io.Serializable
    This class implements a histogram that adapts to an unknown data distribution. It keeps a more or less constant resolution throughout the data range by increasing the resolution where the data is more dense. For example, if the data has such such a distribution that most of the values lie in the 0-5 range and only a few are in the 5-10 range, the histogram would adapt and assign more counting buckets to the 0-5 range and less to the 5-10 range. This implementation provides a method to obtain the accumulative density function for a given data point, and a method to obtain the data point that splits the data set at a given percentile.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      AdaptiveHistogram()
      Class constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addValue(float value)
      Adds a data point to the histogram.
      long getAccumCount(float value)
      Returns the cumulative density function for a given data point.
      long getCount(float value)
      Returns the number of data points stored in the same bucket as a given value.
      float getValueForPercentile(int percentile)
      Returns the data point that splits the data set at a given percentile.
      void normalize(float targetMin, float targetMax)
      Normalizes all the values to the desired range.
      void reset()
      Erases all data from the histogram.
      void show()
      Shows the histograms' underlying data structure.
      java.util.ArrayList<Cell> toTable()
      Return a table representing the data in this histogram.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AdaptiveHistogram

        public AdaptiveHistogram()
        Class constructor.
    • Method Detail

      • reset

        public void reset()
        Erases all data from the histogram.
      • addValue

        public void addValue(float value)
        Adds a data point to the histogram.
        Parameters:
        value - the data point to add.
      • getCount

        public long getCount(float value)
        Returns the number of data points stored in the same bucket as a given value.
        Parameters:
        value - the reference data point.
        Returns:
        the number of data points stored in the same bucket as the reference point.
      • getAccumCount

        public long getAccumCount(float value)
        Returns the cumulative density function for a given data point.
        Parameters:
        value - the reference data point.
        Returns:
        the cumulative density function for the reference point.
      • getValueForPercentile

        public float getValueForPercentile(int percentile)
        Returns the data point that splits the data set at a given percentile.
        Parameters:
        percentile - the percentile at which the data set is split.
        Returns:
        the data point that splits the data set at the given percentile.
      • normalize

        public void normalize(float targetMin,
                              float targetMax)
        Normalizes all the values to the desired range.
        Parameters:
        targetMin - the target new minimum value.
        targetMax - the target new maximum value.
      • show

        public void show()
        Shows the histograms' underlying data structure.
      • toTable

        public java.util.ArrayList<Cell> toTable()
        Return a table representing the data in this histogram. Each element is a table cell containing the range limit values and the count for that range.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.