mvpa2.base.dataset.DatasetAttributeExtractor

Inheritance diagram of DatasetAttributeExtractor

class mvpa2.base.dataset.DatasetAttributeExtractor(col, key)

Helper to extract arbitrary attributes from dataset collections.

Examples

>>> ds = AttrDataset(np.arange(12).reshape((4,3)),
...              sa={'targets': range(4)},
...              fa={'foo': [0,0,1]})
>>> ext = DAE('sa', 'targets')
>>> ext(ds)
array([0, 1, 2, 3])
>>> ext = DAE('fa', 'foo')
>>> ext(ds)
array([0, 0, 1])
Parameters:

col : {‘sa’, ‘fa’, ‘a’}

The respective collection to extract an attribute from.

key : arbitrary

The name/key of the attribute in the collection.