Package mvpa :: Package datasets :: Module meta :: Class MetaDataset

[hide private]
[frames] | no frames]

# Class MetaDataset

source code

Dataset container

The class is useful to combine several Datasets with different origin and type and bind them together. Such a combined dataset can then by used to e.g. pass it to a classifier.

MetaDataset does not permanently duplicate data stored in the dataset it contains. The combined samples matrix is build on demand and samples attribute access is redirected to the first dataset in the container.

Currently operations other than samples or feature selection are not fully supported, e.g. passing a MetaDataset to detrend() will initially result in a detrended MetaDataset, but the combined and detrended samples matrix will be lost after the next call to selectSamples() or selectFeatures(), which freshly pulls samples from all datasets in the container.

Instance Methods | [hide private]

__init__(self, datasets) Initialize dataset instance | source code

rebuildSamples(self) Update the combined samples matrix from all underlying datasets. | source code

__getattr__(self, name) Implemented to redirect access to underlying datasets. | source code

selectFeatures(self, ids, sort=True) Do feature selection on all underlying datasets at once. | source code

applyMapper(self, *args, **kwargs) Apply a mapper on all underlying datasets. | source code

selectSamples(self, *args, **kwargs) Select samples from all underlying datasets at once. | source code

permuteLabels(self, *args, **kwargs) Toggle label permutation. | source code

getRandomSamples(self, nperlabel) Return a MetaDataset with a random subset of samples. | source code

getNSamples(self) Currently available number of samples. | source code

getNFeatures(self) Number of features per sample. | source code

setSamplesDType(self, dtype) Set the data type of the samples array. | source code

mapReverse(self, val) Perform reverse mapping | source code

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

Class Variables | [hide private]

| nsamples = `property(fget= getNSamples)`
| nfeatures = `property(fget= getNFeatures)`
| datasets = `property(fget= lambda self: self.__datasets)`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, datasets)
(Constructor)

source code

Initialize dataset instance

Overrides: object.__init__

Parameters: datasets : list

### mapReverse(self, val)

source code

Perform reverse mapping

Returns:
  List of results per each used mapper and the corresponding part of the provided `val`.