Package mvpa :: Package measures :: Module base :: Class DatasetMeasure
[hide private]
[frames] | no frames]

Class DatasetMeasure

source code


A measure computed from a Dataset

All dataset measures support arbitrary transformation of the measure after it has been computed. Transformation are done by processing the measure with a functor that is specified via the transformer keyword argument of the constructor. Upon request, the raw measure (before transformations are applied) is stored in the raw_results state variable.

Additionally all dataset measures support the estimation of the probabilit(y,ies) of a measure under some distribution. Typically this will be the NULL distribution (no signal), that can be estimated with permutation tests. If a distribution estimator instance is passed to the null_dist keyword argument of the constructor the respective probabilities are automatically computed and stored in the null_prob state variable.

For developers: All subclasses shall get all necessary parameters via their constructor, so it is possible to get the same type of measure for multiple datasets by passing them to the __call__() method successively.
Nested Classes [hide private]

Inherited from misc.state.ClassWithCollections: __metaclass__

Instance Methods [hide private]
 
__init__(self, transformer=None, null_dist=None, **kwargs)
Does nothing special.
source code
 
__call__(self, dataset)
Compute measure on a given Dataset.
source code
 
_call(self, dataset)
Actually compute measure on a given Dataset.
source code
 
_postcall(self, dataset, result)
Some postprocessing on the result
source code
 
__repr__(self, prefixes=[])
String representation of DatasetMeasure
source code
 
untrain(self)
'Untraining' Measure
source code
 
null_dist(self)
Return Null Distribution estimator
source code
 
transformer(self)
Return transformer
source code

Inherited from misc.state.ClassWithCollections: __getattribute__, __new__, __setattr__, __str__, reset

Inherited from object: __delattr__, __format__, __hash__, __reduce__, __reduce_ex__, __sizeof__, __subclasshook__

Class Variables [hide private]
  raw_results = StateVariable(enabled= False, doc= "Computed res...
  null_prob = StateVariable(enabled= True)
Stores the probability of a measure under the NULL hypothesis
  null_t = StateVariable(enabled= False)
Stores the t-score corresponding to null_prob under assumption of Normal distribution
  __doc__ = enhancedDocString('DatasetMeasure', locals(), ClassW...

Inherited from misc.state.ClassWithCollections: _DEV__doc__, descr

Instance Variables [hide private]
  __transformer
Functor to be called in return statement of all subclass __call__() methods.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, transformer=None, null_dist=None, **kwargs)
(Constructor)

source code 
Does nothing special.
Parameters:
  • transformer, Functor - This functor is called in __call__() to perform a final processing step on the to be returned dataset measure. If None, nothing is called
  • null_dist, instance, of, distribution, estimator - The estimated distribution is used to assign a probability for a certain value of the computed measure.
Overrides: object.__init__

__call__(self, dataset)
(Call operator)

source code 

Compute measure on a given Dataset.

Each implementation has to handle a single arguments: the source dataset.

Returns the computed measure in some iterable (list-like) container applying transformer if such is defined

_call(self, dataset)

source code 

Actually compute measure on a given Dataset.

Each implementation has to handle a single arguments: the source dataset.

Returns the computed measure in some iterable (list-like) container.

__repr__(self, prefixes=[])
(Representation operator)

source code 

String representation of DatasetMeasure

Includes only arguments which differ from default ones

Parameters:
  • fullname - Either to include full name of the module
  • prefixes - What other prefixes to prepend to list of arguments
Overrides: object.__repr__

untrain(self)

source code 

'Untraining' Measure

Some derived classes might used classifiers, so we need to untrain those

null_dist(self)

source code 
Return Null Distribution estimator
Decorators:
  • @property

transformer(self)

source code 
Return transformer
Decorators:
  • @property

Class Variable Details [hide private]

raw_results

Value:
StateVariable(enabled= False, doc= "Computed results before applying a\
ny "+ "transformation algorithm")

__doc__

Value:
enhancedDocString('DatasetMeasure', locals(), ClassWithCollections)