nltk.MutableProbDist
¶
-
class
nltk.
MutableProbDist
(prob_dist, samples, store_logs=True)[source]¶ An mutable probdist where the probabilities may be easily modified. This simply copies an existing probdist, storing the probability values in a mutable dictionary and providing an update method.
Methods¶
__init__ (prob_dist, samples[, store_logs]) |
Creates the mutable probdist based on the given prob_dist and using the list of samples given. |
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) |
|
max () |
Return the sample with the greatest probability. |
prob (sample) |
|
samples () |
|
update (sample, prob[, log]) |
Update the probability for the given sample. |
Attributes¶
SUM_TO_ONE |