nltk :: probability :: LaplaceProbDist :: Class LaplaceProbDist
[hide private]
[frames] | no frames]

Class 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.

Instance Methods [hide private]
 
__init__(self, freqdist, bins=None)
Use the Laplace estimate to create a probability distribution for the experiment used to generate freqdist.
string
__repr__(self)
Returns: A string representation of this ProbDist.

Inherited from LidstoneProbDist: discount, freqdist, max, prob, samples

Inherited from ProbDistI: generate, logprob

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from LidstoneProbDist: SUM_TO_ONE

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

 

Use the Laplace estimate to create a probability distribution for the experiment used to generate freqdist.

Parameters:
  • freqdist (FreqDist) - The frequency distribution that the probability estimates should be based on.
  • bins (int) - 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().
Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Returns: string
A string representation of this ProbDist.
Overrides: object.__repr__