Package nltk :: Module probability :: Class ConditionalProbDistI
[hide private]
[frames] | no frames]

Class ConditionalProbDistI

source code

object --+
         |
        ConditionalProbDistI
Known Subclasses:

A collection of probability distributions for a single experiment run under different conditions. Conditional probability distributions are used to estimate the likelihood of each sample, given the condition under which the experiment was run. For example, a conditional probability distribution could be used to estimate the probability of each word type in a document, given the length of the word type. Formally, a conditional probability distribution can be defined as a function that maps from each condition to the ProbDist for the experiment under that condition.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
ProbDistI
__getitem__(self, condition)
Returns: The probability distribution for the experiment run under the given condition.
source code
int
__len__(self)
Returns: The number of conditions that are represented by this ConditionalProbDist.
source code
list
conditions(self)
Returns: A list of the conditions that are represented by this ConditionalProbDist.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__getitem__(self, condition)
(Indexing operator)

source code 
Parameters:
  • condition (any) - The condition whose probability distribution should be returned.
Returns: ProbDistI
The probability distribution for the experiment run under the given condition.

__len__(self)
(Length operator)

source code 
Returns: int
The number of conditions that are represented by this ConditionalProbDist.

conditions(self)

source code 
Returns: list
A list of the conditions that are represented by this ConditionalProbDist. Use the indexing operator to access the probability distribution for a given condition.