public class DiscreteEstimatorBayes extends Estimator implements Scoreable
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
m_Counts
Hold the counts
|
protected double |
m_fPrior
Holds the prior probability
|
protected int |
m_nSymbols
Holds number of symbols in distribution
|
protected double |
m_SumOfCounts
Hold the sum of counts
|
m_classValueIndex, m_DoNotCheckCapabilities, m_noClass| Constructor and Description |
|---|
DiscreteEstimatorBayes(int nSymbols,
double fPrior)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(double data,
double weight)
Add a new data value to the current estimator.
|
double |
getCount(double data)
Get a counts for a value
|
int |
getNumSymbols()
Gets the number of symbols this estimator operates with
|
double |
getProbability(double data)
Get a probability estimate for a value
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
logScore(int nType,
int nCardinality)
Gets the log score contribution of this distribution
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
toString()
Display a representation of this estimator
|
addValues, addValues, addValues, addValues, buildEstimator, buildEstimator, clone, debugTipText, doNotCheckCapabilitiesTipText, equals, forName, getCapabilities, getDebug, getDoNotCheckCapabilities, getOptions, listOptions, makeCopies, makeCopy, setDebug, setDoNotCheckCapabilities, setOptions, testCapabilitiesprotected double[] m_Counts
protected double m_SumOfCounts
protected int m_nSymbols
protected double m_fPrior
public DiscreteEstimatorBayes(int nSymbols,
double fPrior)
nSymbols - the number of possible symbols (remember to include 0)fPrior - public void addValue(double data,
double weight)
public double getProbability(double data)
getProbability in class Estimatordata - the value to estimate the probability ofpublic double getCount(double data)
data - the value to get the counts forpublic int getNumSymbols()
public double logScore(int nType,
int nCardinality)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Estimatorpublic static void main(java.lang.String[] argv)
argv - should contain a sequence of integers which
will be treated as symbolic.