Package mvpa :: Package mappers :: Module base :: Class Mapper
[hide private]
[frames] | no frames]

Class Mapper

source code


Interface to provide mapping between two spaces: in and out.

Methods are prefixed correspondingly. forward/reverse operate on the entire dataset. get(In|Out)Id[s] operate per element:

      forward
in   ---------> out
     <--------/
       reverse

Subclasses should define 'dsshape' and 'nfeatures' properties that point to getInShape and getOutSize respectively. This cannot be done in the baseclass as standard Python properties would still point to the baseclass methods.

Constructor information for Mapper class

Does nothing.

Instance Methods [hide private]
 
__init__(self)
Does nothing.
source code
 
forward(self, data)
Map data from the original dataspace into featurespace.
source code
 
__call__(self, data)
Calls the mappers forward() method.
source code
 
reverse(self, data)
Reverse map data from featurespace into the original dataspace.
source code
 
train(self, dataset)
Sub-classes have to override this method if the mapper need training.
source code
 
getInShape(self)
Returns the dimensionality specification of the original dataspace.
source code
 
getOutShape(self)
Returns the shape (or other dimensionality speicification) of the destination dataspace.
source code
 
getInSize(self)
Returns the size of the entity in input space
source code
 
getOutSize(self)
Returns the size of the entity in output space
source code
 
selectOut(self, outIds)
Remove some elements and leave only ids in 'out'/feature space
source code

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

Class Variables [hide private]
  __doc__ = enhancedDocString('Mapper', locals())
  nfeatures = VProperty(fget= getOutSize)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Does nothing.
Overrides: object.__init__

getInShape(self)

source code 

Returns the dimensionality specification of the original dataspace.

XXX -- should be deprecated and might be substituted with functions like getEmptyFrom / getEmptyTo