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

Type LaplaceProbDist

  object --+        
           |        
   ProbDistI --+    
               |    
LidstoneProbDist --+
                   |
                  LaplaceProbDist


The Laplace estimate for the probability distribution of the experiment used to generate a frequency distribution. The Lidstone estimate approximates the probability of a sample with count c from an experiment with N outcomes and B bins as (c+1)/(N+B). This is equivalant to adding one to the count for each bin, and taking the maximum likelihood estimate of the resulting frequency distribution.
Method Summary
  __init__(self, freqdist, bins)
Use the Laplace estimate to create a probability distribution for the experiment used to generate freqdist.
string __repr__(self)
Return a string representation of this ProbDist.
Inherited from LidstoneProbDist: freqdist, max, prob, samples
Inherited from ProbDistI: logprob
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Method Details

__init__(self, freqdist, bins=None)
(Constructor)

Use the Laplace 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)
bins - The number of sample values that can be generated by the experiment that is described by the probability distribution. This value must be correctly set for the probabilities of the sample values to sum to one. If bins is not specified, it defaults to freqdist.B().
           (type=int)
Overrides:
nltk_lite.probability.LidstoneProbDist.__init__

__repr__(self)
(Representation operator)

Returns:
A string representation of this ProbDist.
           (type=string)
Overrides:
nltk_lite.probability.LidstoneProbDist.__repr__

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