Package mvpa :: Package mappers :: Module samplegroup :: Class SampleGroupMapper

[hide private]
[frames] | no frames]

# Class SampleGroupMapper

source code

Mapper to apply a mapping function to samples of the same type.

A customimzable function is applied individually to all samples with the same unique label from the same chunk. This mapper is somewhat unconventional since it doesn't preserve number of samples (ie the size of 0-th dimension...)

Instance Methods | [hide private]

__init__(self, fx=FirstAxisMean) Initialize the PCAMapper | source code

train(self, dataset) Perform training of the mapper. | source code

forward(self, data) Map data from the IN dataspace into OUT space. | source code

reverse(self, data) This is not implemented. | source code

getInSize(self) Returns the number of original samples which were combined. | source code

getOutSize(self) Returns the number of output samples. | source code

selectOut(self, outIds) Just complain for now | source code

Inherited from `base.Mapper`: `__call__`, `__repr__`, `getInId`, `getMetric`, `getNeighbor`, `getNeighborIn`, `getNeighbors`, `isValidInId`, `isValidOutId`, `setMetric` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| __doc__ = `enhancedDocString('SampleGroupMapper', locals(), Map`...``
Inherited from `base.Mapper`: `metric`, `nfeatures`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, fx=FirstAxisMean)
(Constructor)

source code

Initialize the PCAMapper

Parameters:
  startpoints: A sequence of index value along the first axis of
    'data'.
  boxlength: The number of elements after 'startpoint' along the
    first axis of 'data' to be considered for averaging.
  offset: The offset between the starting point and the
    averaging window (boxcar).
  collision_resolution : string
    if a sample belonged to multiple output samples, then on reverse, how to resolve the value (choices: 'mean')

Parameters:
  - `metric` - Optional metric
Overrides: object.__init__

### train(self, dataset)

source code

Perform training of the mapper.

This method is called to put the mapper in a state that allows it to perform to intended mapping.

The default behavior of this method is to do nothing.

Overrides: base.Mapper.train

### forward(self, data)

source code

Map data from the IN dataspace into OUT space.

Overrides: base.Mapper.forward

### reverse(self, data)

source code

This is not implemented.

Overrides: base.Mapper.reverse

### getInSize(self)

source code

Returns the number of original samples which were combined.

Overrides: base.Mapper.getInSize

### getOutSize(self)

source code

Returns the number of output samples.

Overrides: base.Mapper.getOutSize

### selectOut(self, outIds)

source code

Just complain for now

Parameters:
  - `outIds`, `sequence` - Subset of ids of the current feature in OUT space to keep.
Overrides: base.Mapper.selectOut

Class Variable Details | [hide private]

### __doc__

Value:

      enhancedDocString('SampleGroupMapper', locals(), Mapper)