ValueType
- Value for the domain (x-axis, independent variable), may be something
like an Integer, etc; must be Comparable for use with TreeSetBinner.@CodeReview(reviewer="Justin Basilico", date="2009-05-29", changesNeeded=false, comments="Cleaned up the formatting and javadoc.") public class DataCountTreeSetBinnedMapHistogram<ValueType extends java.lang.Comparable<? super ValueType>> extends DefaultDataDistribution<ValueType>
DataCountTreeSetBinnedMapHistogram
class extends a
DefaultDataDistribution
by mapping values to user defined bins
using a TreeSetBinner
. The values in a given bin are inclusive
of the lower bound of the bin and exclusive of the upper bound of the bin.DefaultDataDistribution.DefaultFactory<DataType>, DefaultDataDistribution.Estimator<KeyType>, DefaultDataDistribution.PMF<KeyType>, DefaultDataDistribution.WeightedEstimator<KeyType>
AbstractMutableDoubleMap.Entry<KeyType>, AbstractMutableDoubleMap.SimpleEntry<KeyType>, AbstractMutableDoubleMap.SimpleEntrySet<KeyType>, AbstractMutableDoubleMap.SimpleIterator<KeyType>
ScalarMap.Entry<KeyType>
DEFAULT_INITIAL_CAPACITY, total
map
Constructor and Description |
---|
DataCountTreeSetBinnedMapHistogram(java.util.Collection<? extends ValueType> binBoundaries)
Creates a new
DataCountTreeBinnedMapHistogram using
the provided list of bin boundaries. |
DataCountTreeSetBinnedMapHistogram(TreeSetBinner<ValueType> binner)
Creates a new
DataCountTreeBinnedMapHistogram using the provided
TreeSetBinner . |
Modifier and Type | Method and Description |
---|---|
double |
decrement(ValueType key,
double value)
Decrements the value associated with the given key by the given amount.
|
int |
getBinCount()
Gets the total number of bins.
|
TreeSetBinner<ValueType> |
getBinner()
Gets the TreeSetBinner used to perform value binning.
|
double |
increment(ValueType key,
double value)
Increments the value associated with the given key by the given amount.
|
clear, clone, getEstimator, getMeanValue, getProbabilityFunction, getTotal, set
fromInfiniteVector, getDomain, getDomainSize, getEntropy, getFraction, getLogFraction, getMaxValue, getMinValue, sample, sample, sampleInto, toInfiniteVector
asMap, compact, entrySet, get
containsKey, decrement, decrementAll, decrementAll, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, increment, incrementAll, incrementAll, isEmpty, keySet, setAll, setAll, size
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asMap, decrement, decrementAll, decrementAll, entrySet, get, increment, incrementAll, incrementAll, setAll, setAll
containsKey, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, isEmpty, keySet, size
public DataCountTreeSetBinnedMapHistogram(TreeSetBinner<ValueType> binner)
DataCountTreeBinnedMapHistogram
using the provided
TreeSetBinner
.binner
- The TreeSetBinner to use to perform value binning.public DataCountTreeSetBinnedMapHistogram(java.util.Collection<? extends ValueType> binBoundaries)
DataCountTreeBinnedMapHistogram
using
the provided list of bin boundaries. The bin boundary list will
be used to initialize a TreeSetBinner for performing value binning.binBoundaries
- The values to be used as boundary cutoffs for bins; bin membership
is inclusive of the lower bin bound and exclusive of the upper bin
bound.public double increment(ValueType key, double value)
ScalarMap
increment
in interface ScalarMap<ValueType extends java.lang.Comparable<? super ValueType>>
increment
in class DefaultDataDistribution<ValueType extends java.lang.Comparable<? super ValueType>>
key
- A key.value
- The amount to increment the value associated with the given key by.public double decrement(ValueType key, double value)
ScalarMap
decrement
in interface ScalarMap<ValueType extends java.lang.Comparable<? super ValueType>>
decrement
in class AbstractScalarMap<ValueType extends java.lang.Comparable<? super ValueType>,MutableDouble>
key
- A key.value
- The amount to decrement the value associated with the given key by.public int getBinCount()
public TreeSetBinner<ValueType> getBinner()