Package mvpa :: Package mappers :: Module boxcar :: Class BoxcarMapper
[hide private]
[frames] | no frames]

Class BoxcarMapper

source code


Mapper to combine multiple samples into a single sample.

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, startpoints, boxlength, offset=0, collision_resolution='mean')
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
forward(self, data)
Project an ND matrix into N+1D matrix
source code
 
reverse(self, data)
Uncombine features back into original space.
source code
 
getInSize(self)
Returns the number of original samples which were combined.
source code
 
isValidOutId(self, outId)
Validate if OutId is valid
source code
 
isValidInId(self, inId)
Validate if InId is valid
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__, getInId, getMetric, getNeighbor, getNeighborIn, getNeighbors, setMetric, train

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _COLLISION_RESOLUTIONS = ['mean']
  __doc__ = enhancedDocString('BoxcarMapper', locals(), Mapper)

Inherited from base.Mapper: metric, nfeatures

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, startpoints, boxlength, offset=0, collision_resolution='mean')
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Parameters:
  • startpoints, sequence - Index values along the first axis of 'data'.
  • boxlength, int - The number of elements after 'startpoint' along the first axis of 'data' to be considered for the boxcar.
  • offset, int - The offset between the provided starting point and the actual start of the boxcar.
  • collision_resolution ('mean') - if a sample belonged to multiple output samples, then on reverse, how to resolve the value
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

forward(self, data)

source code 

Project an ND matrix into N+1D matrix

This method also handles the special of forward mapping a single 'raw' sample. Such a sample is extended (by concatenating clones of itself) to cover a full boxcar. This functionality is only availably after a full data array has been forward mapped once.

Returns:
array: (#startpoint, ...)
Overrides: base.Mapper.forward

reverse(self, data)

source code 

Uncombine features back into original space.

Samples which were not touched by forward will get value 0 assigned

Overrides: base.Mapper.reverse

getInSize(self)

source code 
Returns the number of original samples which were combined.
Overrides: base.Mapper.getInSize

isValidOutId(self, outId)

source code 
Validate if OutId is valid
Overrides: base.Mapper.isValidOutId

isValidInId(self, inId)

source code 
Validate if InId is valid
Overrides: base.Mapper.isValidInId

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