nltk.LidstoneProbDist
¶
-
class
nltk.
LidstoneProbDist
(freqdist, gamma, bins=None)[source]¶ The Lidstone estimate for the probability distribution of the experiment used to generate a frequency distribution. The “Lidstone estimate” is parameterized by a real number gamma, which typically ranges from 0 to 1. The Lidstone estimate approximates the probability of a sample with count c from an experiment with N outcomes and B bins as
c+gamma)/(N+B*gamma)
. This is equivalent to adding gamma to the count for each bin, and taking the maximum likelihood estimate of the resulting frequency distribution.
Methods¶
__init__ (freqdist, gamma[, bins]) |
Use the Lidstone estimate to create a probability distribution for the experiment used to generate freqdist . |
discount () |
|
freqdist () |
Return the frequency distribution that this probability distribution is based on. |
generate () |
Return a randomly selected sample from this probability distribution. |
logprob (sample) |
Return the base 2 logarithm of the probability for a given sample. |
max () |
|
prob (sample) |
|
samples () |
|
unicode_repr () |
Return a string representation of this ProbDist . |
Attributes¶
SUM_TO_ONE |