Mapper to select a subset of features.
Depending on the actual slicing two FeatureSelections can be merged in a number of ways: incremental selection (+=), union (&=) and intersection (|=). Were the former assumes that two feature selections are applied subsequently, and the latter two assume that both slicings operate on the set of input features.
Notes
Available conditional attributes:
(Conditional attributes enabled by default suffixed with +)
Examples
>>> from mvpa2.datasets import *
>>> ds = Dataset([[1,2,3,4,5]])
>>> fs0 = StaticFeatureSelection([0,1,2,3])
>>> fs0(ds).samples
array([[1, 2, 3, 4]])
Merge two incremental selections: the resulting mapper performs a selection that is equivalent to first applying one slicing and subsequently the next slicing. In this scenario the slicing argument of the second mapper is relative to the output feature space of the first mapper.
>>> fs1 = StaticFeatureSelection([0,2])
>>> fs0 += fs1
>>> fs0(ds).samples
array([[1, 3]])
Methods
forward(data) | Map data from input to output space. |
forward1(data) | Wrapper method to map single samples. |
generate(ds) | Yield processing results. |
get_postproc() | Returns the post-processing node or None. |
get_space() | Query the processing space name of this node. |
reset() | |
reverse(data) | Reverse-map data from output back into input space. |
reverse1(data) | |
set_postproc(node) | Assigns a post-processing node |
set_space(name) | Set the processing space name of this node. |
train(ds) | The default implementation calls _pretrain(), _train(), and finally _posttrain(). |
untrain() | Reverts changes in the state of this node caused by previous training |
Parameters: | filler : optional
enable_ca : None or list of str
disable_ca : None or list of str
auto_train : bool
force_train : bool
space : str, optional
pass_attr : str, list of str|tuple, optional
postproc : Node instance, optional
descr : str
|
---|
Methods
forward(data) | Map data from input to output space. |
forward1(data) | Wrapper method to map single samples. |
generate(ds) | Yield processing results. |
get_postproc() | Returns the post-processing node or None. |
get_space() | Query the processing space name of this node. |
reset() | |
reverse(data) | Reverse-map data from output back into input space. |
reverse1(data) | |
set_postproc(node) | Assigns a post-processing node |
set_space(name) | Set the processing space name of this node. |
train(ds) | The default implementation calls _pretrain(), _train(), and finally _posttrain(). |
untrain() | Reverts changes in the state of this node caused by previous training |