public class Multinomial extends FeatureVector
FeatureVector.
The values associated with each element in the Multinomial/FeaturVector are probabilities
and should sum to 1.
Features are indexed using feature indices - the index into the underlying Alphabet -
rather than using locations the way FeatureVectors do.
Multinomial.Estimator provides a subhierachy
of ways to generate an estimate of the probability distribution from counts associated
with the features.
| Modifier and Type | Class and Description |
|---|---|
static class |
Multinomial.Estimator
A hierarchy of classes used to produce estimates of probabilities, in
the form of a Multinomial, from counts associated with the elements
of an Alphabet.
|
static class |
Multinomial.LaplaceEstimator
An MEstimator with m set to 1.
|
static class |
Multinomial.Logged
A Multinomial in which the values associated with each feature index fi is
Math.log(probability[fi]) instead of probability[fi].
|
static class |
Multinomial.MAPEstimator
Unimplemented, but the MEstimators are.
|
static class |
Multinomial.MEstimator
An Estimator in which probability estimates in a Multinomial
are generated by adding a constant m (specified at construction time)
to each count before dividing by the total of the m-biased counts.
|
static class |
Multinomial.MLEstimator
An MEstimator with m set to 0.
|
hasInfinite, indices, values| Modifier | Constructor and Description |
|---|---|
|
Multinomial(double[] probabilities) |
|
Multinomial(double[] probabilities,
Alphabet dictionary) |
protected |
Multinomial(double[] probabilities,
Alphabet dictionary,
int size,
boolean copy,
boolean checkSum) |
|
Multinomial(double[] probabilities,
int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProbabilitiesTo(double[] vector) |
Alphabet |
getAlphabet() |
double |
logProbability(int featureIndex) |
double |
logProbability(Object key) |
double |
probability(int featureIndex) |
double |
probability(Object key) |
FeatureSequence |
randomFeatureSequence(Random r,
int length) |
FeatureVector |
randomFeatureVector(Random r,
int size) |
int |
randomIndex(Random r) |
Object |
randomObject(Random r) |
int |
size() |
cloneMatrix, cloneMatrixZeroed, contains, getObjectIndices, location, toSimpFile, toString, toString, valueabsNorm, addTo, addTo, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, indexAtLocation, infinityNorm, isBinary, isNaN, location, makeBinary, makeNonBinary, map, numLocations, oneNorm, plusEqualsSparse, plusEqualsSparse, print, removeDuplicates, setAll, setValue, setValueAtLocation, singleIndex, singleSize, singleToIndices, singleValue, sortIndices, timesEquals, timesEqualsSparse, timesEqualsSparse, twoNorm, value, value, valueAtLocation, vectorAddprotected Multinomial(double[] probabilities,
Alphabet dictionary,
int size,
boolean copy,
boolean checkSum)
public Multinomial(double[] probabilities,
Alphabet dictionary)
public Multinomial(double[] probabilities,
int size)
public Multinomial(double[] probabilities)
public int size()
public double probability(int featureIndex)
public double probability(Object key)
public double logProbability(int featureIndex)
public double logProbability(Object key)
public Alphabet getAlphabet()
getAlphabet in class FeatureVectorpublic void addProbabilitiesTo(double[] vector)
public int randomIndex(Random r)
public FeatureSequence randomFeatureSequence(Random r, int length)
public FeatureVector randomFeatureVector(Random r, int size)
Copyright © 2019 JULIE Lab, Germany. All rights reserved.