Package mvpa :: Package clfs :: Module stats :: Class MCNullDist
[hide private]
[frames] | no frames]

Class MCNullDist

source code


Class to determine the distribution of a measure under the NULL distribution (no signal).

No assumptions are made about the shape of the distribution under the null hypothesis. Instead this distribution is estimated by performing multiple measurements with permuted label vectors, hence no or random signal.

The distribution is estimated by calling fit() with an appropriate DatasetMeasure or TransferError instance and a training and a validation dataset (in case of a TransferError). For a customizable amount of cycles the training data labels are permuted and the corresponding measure computed. In case of a TransferError this is the error when predicting the correct labels of the validation dataset.

The distribution can be queried using the cdf() method, which can be configured to report probabilities/frequencies from left or right tail, i.e. fraction of the distribution that is lower or larger than some critical value.

This class also supports FeaturewiseDatasetMeasure. In that case cdf() returns an array of featurewise probabilities/frequencies.

Instance Methods [hide private]
 
__init__(self, permutations=1000, **kwargs)
Cheap initialization.
source code
 
fit(self, measure, wdata, vdata=None)
Fit the distribution by performing multiple cycles which repeatedly permuted labels in the training dataset.
source code
 
cdf(self, x)
Returns the frequency/probability of a value x given the estimated distribution.
source code

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

Instance Variables [hide private]
  __permutations
Number of permutations to compute the estimate the null distribution.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, permutations=1000, **kwargs)
(Constructor)

source code 
Cheap initialization.
Overrides: object.__init__

fit(self, measure, wdata, vdata=None)

source code 
Fit the distribution by performing multiple cycles which repeatedly permuted labels in the training dataset.
Overrides: Distribution.fit

cdf(self, x)

source code 

Returns the frequency/probability of a value x given the estimated distribution. Returned values are determined left or right tailed depending on the constructor setting.

In case a FeaturewiseDatasetMeasure was used to estimate the distribution the method returns an array. In that case x can be a scalar value or an array of a matching shape.

Overrides: Distribution.cdf