Table Of Contents

Previous topic

mvpa.datasets.event

Next topic

mvpa.datasets.masked

This Page

Quick search

mvpa.datasets.mapped

Mapped dataset

The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.datasets.mapped (for developers).

MappedDataset

class mvpa.datasets.mapped.MappedDataset(samples=None, mapper=None, dsattr=None, **kwargs)

Bases: mvpa.datasets.base.Dataset

A Dataset which is created by applying a Mapper to the data.

Upon contruction MappedDataset uses a Mapper to transform the samples from their original into the two-dimensional matrix representation that is required by the Dataset class.

This class enhanced the Dataset interface with two additional methods: mapForward() and mapReverse(). Both take arbitrary data arrays (with matching shape) and transform them using the embedded mapper from the original dataspace into a one- or two-dimensional representation (for arrays corresponding to the shape of a single or multiple samples respectively) or vice versa.

Most likely, this class will not be used directly, but rather indirectly through one of its subclasses (e.g. MaskedDataset).

If samples and mapper arguments are not None the mapper is used to forward-map the samples array and the result is passed to the Dataset constructor.

Parameters:
  • mapper (Instance of Mapper) – This mapper will be embedded in the dataset and is used and updated, by all subsequent mapping or feature selection procedures.
  • **kwargs – All other arguments are simply passed to and handled by the constructor of Dataset.
O
Return samples in the original shape
mapForward(data)
Map data from the original dataspace into featurespace.
mapReverse(data)
Reverse map data from featurespace into the original dataspace.
mapSelfReverse()
Reverse samples from featurespace into the original dataspace.
mapper
mapper
samples_original
Return samples in the original shape
selectFeatures(ids, plain=False, sort=False)

Select features given their ids.

The methods behaves similar to Dataset.selectFeatures(), but additionally takes care of adjusting the embedded mapper appropriately.

Parameters:
  • ids (sequence) – Iterable container to select ids
  • plain (boolean) – Flag whether to return MappedDataset (or just Dataset)
  • sort (boolean) – Flag whether to sort Ids. Order matters and selectFeatures assumes incremental order. If not such, in non-optimized code selectFeatures would verify the order and sort

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the MappedDataset documentation.

Full API documentation of MappedDataset in module mvpa.datasets.mapped.