Package weka.estimators
Class UnivariateEqualFrequencyHistogramEstimator
java.lang.Object
weka.estimators.UnivariateEqualFrequencyHistogramEstimator
- All Implemented Interfaces:
Serializable
,RevisionHandler
,UnivariateDensityEstimator
,UnivariateIntervalEstimator
,UnivariateQuantileEstimator
public class UnivariateEqualFrequencyHistogramEstimator
extends Object
implements UnivariateDensityEstimator, UnivariateIntervalEstimator, UnivariateQuantileEstimator, Serializable
Simple histogram density estimator. Uses equal-frequency histograms based on
the specified number of bins (default: 10).
- Version:
- $Revision: 11318 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addValue
(double value, double weight) Adds a value to the density estimator.int
Gets the number of binsReturns the revision string.boolean
Gets whether only weights should be udpated.*Returns a string describing the estimator.void
Triggers construction of estimator based on current data and then initializes the statistics.double
logDensity
(double value) Returns the natural logarithm of the density estimate at the given point.static void
Main method, used for testing this class.double[][]
predictIntervals
(double conf) Returns the interval for the given confidence value.double
predictQuantile
(double percentage) Returns the quantile for the given percentage.void
setNumBins
(int numBins) Sets the number of binsvoid
setUpdateWeightsOnly
(boolean flag) Sets whether only weights should be udpated.toString()
Returns textual description of this estimator.
-
Field Details
-
CONST
public static final double CONSTConstant for Gaussian density.
-
-
Constructor Details
-
UnivariateEqualFrequencyHistogramEstimator
public UnivariateEqualFrequencyHistogramEstimator()
-
-
Method Details
-
globalInfo
Returns a string describing the estimator. -
getNumBins
public int getNumBins()Gets the number of bins- Returns:
- the number of bins.
-
setNumBins
public void setNumBins(int numBins) Sets the number of bins- Parameters:
numBins
- the number of bins
-
initializeStatistics
public void initializeStatistics()Triggers construction of estimator based on current data and then initializes the statistics. -
setUpdateWeightsOnly
public void setUpdateWeightsOnly(boolean flag) Sets whether only weights should be udpated. -
getUpdateWeightsOnly
public boolean getUpdateWeightsOnly()Gets whether only weights should be udpated.* -
addValue
public void addValue(double value, double weight) Adds a value to the density estimator.- Specified by:
addValue
in interfaceUnivariateDensityEstimator
- Specified by:
addValue
in interfaceUnivariateIntervalEstimator
- Specified by:
addValue
in interfaceUnivariateQuantileEstimator
- Parameters:
value
- the value to addweight
- the weight of the value
-
predictIntervals
public double[][] predictIntervals(double conf) Returns the interval for the given confidence value.- Specified by:
predictIntervals
in interfaceUnivariateIntervalEstimator
- Parameters:
conf
- the confidence value in the interval [0, 1]- Returns:
- the interval
-
predictQuantile
public double predictQuantile(double percentage) Returns the quantile for the given percentage.- Specified by:
predictQuantile
in interfaceUnivariateQuantileEstimator
- Parameters:
percentage
- the percentage- Returns:
- the quantile
-
logDensity
public double logDensity(double value) Returns the natural logarithm of the density estimate at the given point.- Specified by:
logDensity
in interfaceUnivariateDensityEstimator
- Parameters:
value
- the value at which to evaluate- Returns:
- the natural logarithm of the density estimate at the given value
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
toString
Returns textual description of this estimator. -
main
Main method, used for testing this class.
-