nltk.LaplaceProbDist

class nltk.LaplaceProbDist(freqdist, bins=None)[source]

The Laplace estimate for the probability distribution of the experiment used to generate a frequency distribution. The “Laplace 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 equivalent to adding one to the count for each bin, and taking the maximum likelihood estimate of the resulting frequency distribution.

Methods

__init__(freqdist[, bins]) Use the Laplace 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()
rtype:str

Attributes

SUM_TO_ONE