Class Multinomial

  • All Implemented Interfaces:
    AlphabetCarrying, ConstantMatrix, Vector,
    Direct Known Subclasses:

    public class Multinomial
    extends FeatureVector
    A probability distribution over a set of features represented as a 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.

    Andrew McCallum
    See Also:
    Serialized Form
    • Constructor Detail

      • Multinomial

        protected Multinomial​(double[] probabilities,
                              Alphabet dictionary,
                              int size,
                              boolean copy,
                              boolean checkSum)
      • Multinomial

        public Multinomial​(double[] probabilities,
                           Alphabet dictionary)
      • Multinomial

        public Multinomial​(double[] probabilities,
                           int size)
      • Multinomial

        public Multinomial​(double[] probabilities)
    • Method Detail

      • size

        public int size()
      • probability

        public double probability​(int featureIndex)
      • probability

        public double probability​(java.lang.Object key)
      • logProbability

        public double logProbability​(int featureIndex)
      • logProbability

        public double logProbability​(java.lang.Object key)
      • addProbabilitiesTo

        public void addProbabilitiesTo​(double[] vector)
      • randomIndex

        public int randomIndex​(Randoms r)
      • randomObject

        public java.lang.Object randomObject​(Randoms r)