Package nltk_lite :: Module probability :: Class MLEProbDist
[show private | hide private]
[frames | no frames]

Type MLEProbDist

object --+    
         |    
 ProbDistI --+
             |
            MLEProbDist


The maximum likelihood estimate for the probability distribution of the experiment used to generate a frequency distribution. The maximum likelihood estimate approximates the probability of each sample as the frequency of that sample in the frequency distribution.
Method Summary
  __init__(self, freqdist)
Use the maximum likelihood estimate to create a probability distribution for the experiment used to generate freqdist.
string __repr__(self)
Return a string representation of this ProbDist.
FreqDist freqdist(self)
Return the frequency distribution that this probability distribution is based on.
any max(self)
Return the sample with the greatest probability.
float prob(self, sample)
Return the probability for a given sample.
list samples(self)
Return a list of all samples that have nonzero probabilities.
Inherited from ProbDistI: logprob
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Method Details

__init__(self, freqdist)
(Constructor)

Use the maximum likelihood estimate to create a probability distribution for the experiment used to generate freqdist.
Parameters:
freqdist - The frequency distribution that the probability estimates should be based on.
           (type=FreqDist)
Overrides:
nltk_lite.probability.ProbDistI.__init__

__repr__(self)
(Representation operator)

Returns:
A string representation of this ProbDist.
           (type=string)
Overrides:
__builtin__.object.__repr__

freqdist(self)

Returns:
The frequency distribution that this probability distribution is based on.
           (type=FreqDist)

max(self)

Returns:
the sample with the greatest probability. If two or more samples have the same probability, return one of them; which sample is returned is undefined.
           (type=any)
Overrides:
nltk_lite.probability.ProbDistI.max (inherited documentation)

prob(self, sample)

Parameters:
sample - The sample whose probability should be returned.
           (type=any)
Returns:
the probability for a given sample. Probabilities are always real numbers in the range [0, 1].
           (type=float)
Overrides:
nltk_lite.probability.ProbDistI.prob (inherited documentation)

samples(self)

Returns:
A list of all samples that have nonzero probabilities. Use prob to find the probability of each sample.
           (type=list)
Overrides:
nltk_lite.probability.ProbDistI.samples (inherited documentation)

Generated by Epydoc 2.1 on Tue Sep 5 09:37:22 2006 http://epydoc.sf.net