public static class CategoricalDistribution.PMF extends CategoricalDistribution implements ProbabilityMassFunction<Vector>, VectorInputEvaluator<Vector,java.lang.Double>
CategoricalDistribution.PMF
DEFAULT_NUM_CLASSES, parameters
Constructor and Description |
---|
PMF()
Creates a new instance of CategoricalDistribution
|
PMF(CategoricalDistribution other)
Copy constructor
|
PMF(int numClasses)
Creates a new instance of CategoricalDistribution
|
PMF(Vector parameters)
Creates a new instance of CategoricalDistribution
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
evaluate(Vector input)
Evaluates the function on the given input and returns the output.
|
double |
getEntropy()
Gets the entropy of the values in the histogram.
|
CategoricalDistribution.PMF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
logEvaluate(Vector input)
Evaluate the natural logarithm of the distribution function.
|
clone, convertFromVector, convertToVector, getDomain, getDomainSize, getInputDimensionality, getMean, getParameters, sampleInto, setParameters
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomain, getDomainSize
sample, sample, sampleInto
clone
getInputDimensionality
public PMF()
public PMF(int numClasses)
numClasses
- Number of classes (labels or parameters) to use.public PMF(Vector parameters)
parameters
- Parameters of the multinomial distribution, must be at least
2-dimensional and each element must be nonnegative.public PMF(CategoricalDistribution other)
other
- CategoricalDistribution to copypublic double getEntropy()
ProbabilityMassFunction
getEntropy
in interface ProbabilityMassFunction<Vector>
public double logEvaluate(Vector input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<Vector>
input
- The input to be evaluatedpublic java.lang.Double evaluate(Vector input)
Evaluator
public CategoricalDistribution.PMF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<Vector>
getProbabilityFunction
in interface DiscreteDistribution<Vector>
getProbabilityFunction
in interface ProbabilityMassFunction<Vector>
getProbabilityFunction
in class CategoricalDistribution