nltk.ProbDistI

class nltk.ProbDistI[source]

A probability distribution for the outcomes of an experiment. A probability distribution specifies how likely it is that an experiment will have any given outcome. For example, a probability distribution could be used to predict the probability that a token in a document will have a given type. Formally, a probability distribution can be defined as a function mapping from samples to nonnegative real numbers, such that the sum of every number in the function’s range is 1.0. A ProbDist is often used to model the probability distribution of the experiment used to generate a frequency distribution.

Methods

__init__()
discount() Return the ratio by which counts are discounted on average: c*/c
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() Return the sample with the greatest probability.
prob(sample) Return the probability for a given sample.
samples() Return a list of all samples that have nonzero probabilities.

Attributes

SUM_TO_ONE