The heldout estimate for the probability distribution of the
experiment used to generate two frequency distributions. These two
frequency distributions are called the "heldout frequency
distribution" and the "base frequency distribution." The
heldout
estimate uses uses the heldout frequency distribution to predict the
probability of each sample, given its frequency in the base
frequency distribution.
In particular, the heldout estimate approximates the probability for a
sample that occurs r times in the base distribution
as the average frequency in the heldout distribution of all samples that
occur r times in the base distribution.
|
__init__(self,
base_fdist,
heldout_fdist,
bins=None)
Use the heldout estimate to create a probability distribution for the
experiment used to generate base_fdist and
heldout_fdist . |
source code
|
|
list of float
|
_calculate_Tr(self)
Returns:
the list Tr, where Tr[r] is
the total count in heldout_fdist for all samples that
occur r times in base_fdist . |
source code
|
|
list of float
|
_calculate_estimate(self,
Tr,
Nr,
N)
Returns:
the list estimate, where estimate[r] is the probability estimate for any
sample that occurs r times in the base frequency
distribution. |
source code
|
|
FreqDist
|
base_fdist(self)
Returns:
The base frequency distribution that this probability distribution is
based on. |
source code
|
|
FreqDist
|
heldout_fdist(self)
Returns:
The heldout frequency distribution that this probability distribution
is based on. |
source code
|
|
list
|
|
float
|
prob(self,
sample)
Returns:
the probability for a given sample. |
source code
|
|
any
|
max(self)
Returns:
the sample with the greatest probability. |
source code
|
|
float
|
|
string
|
|
Inherited from ProbDistI :
generate ,
logprob
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__
|