class documentation

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.

Method __init__ Classes inheriting from ProbDistI should implement __init__.
Method discount Return the ratio by which counts are discounted on average: c*/c
Method generate Return a randomly selected sample from this probability distribution. The probability of returning each sample samp is equal to self.prob(samp).
Method logprob Return the base 2 logarithm of the probability for a given sample.
Method max Return the sample with the greatest probability. If two or more samples have the same probability, return one of them; which sample is returned is undefined.
Method prob Return the probability for a given sample. Probabilities are always real numbers in the range [0, 1].
Method samples Return a list of all samples that have nonzero probabilities. Use prob to find the probability of each sample.
Constant SUM_TO_ONE True if the probabilities of the samples in this probability distribution will always sum to one.
def generate(self): (source)

Return a randomly selected sample from this probability distribution. The probability of returning each sample samp is equal to self.prob(samp).

def logprob(self, sample): (source)

Return the base 2 logarithm of the probability for a given sample.

Parameters
sample:anyThe sample whose probability should be returned.
Returns
floatUndocumented
@abstractmethod
def max(self): (source)
@abstractmethod
def prob(self, sample): (source)
SUM_TO_ONE: bool = (source)

True if the probabilities of the samples in this probability distribution will always sum to one.

Value
True