|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.flaptor.hist4j.AdaptiveHistogram
public class AdaptiveHistogram
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.
| Nested Class Summary | |
|---|---|
protected static interface |
AdaptiveHistogram.ValueConversion
Auxiliary interface for inline functor object. |
| Constructor Summary | |
|---|---|
AdaptiveHistogram()
Class constructor. |
|
| Method Summary | |
|---|---|
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. |
protected int |
getCountPerNodeLimit()
This method is used by the internal data structure of the histogram to get the limit of data points that should be counted at one bucket. |
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AdaptiveHistogram()
| Method Detail |
|---|
public void reset()
public void addValue(float value)
value - the data point to add.public long getCount(float value)
value - the reference data point.
public long getAccumCount(float value)
value - the reference data point.
public float getValueForPercentile(int percentile)
percentile - the percentile at which the data set is split.
protected int getCountPerNodeLimit()
public void normalize(float targetMin,
float targetMax)
targetMin - the target new minimum value.targetMax - the target new maximum value.public void show()
public java.util.ArrayList<Cell> toTable()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||