Mapper to select features & samples based on some sensitivity value.
A use case is feature selection across participants, where either the same features are selected in all participants or not (see select_common_features parameter).
Notes
Available conditional attributes:
(Conditional attributes enabled by default suffixed with +)
Examples
>>> nf = 10
>>> ns = 100
>>> nsubj = 5
>>> nchunks = 5
>>> data = np.random.normal(size=(ns, nf))
>>> from mvpa2.base.dataset import AttrDataset
>>> from mvpa2.measures.anova import OneWayAnova
>>> ds = AttrDataset(data,
... sa=dict(sidx=np.arange(ns),
... targets=np.arange(ns) % nchunks,
... chunks=np.floor(np.arange(ns) * nchunks / ns),
... subjects=np.arange(ns) / (ns / nsubj / nchunks) % nsubj),
... fa=dict(fidx=np.arange(nf)))
>>> analyzer=OneWayAnova()
>>> element_selector=FractionTailSelector(.4, mode='select', tail='upper')
>>> common=True
>>> m=SplitSamplesProbabilityMapper(analyzer, 'subjects',
... probability_label='fprob',
... select_common_features=common,
... selector=element_selector)
>>> m.train(ds)
>>> y=m(ds)
>>> z=m(ds.samples)
>>> np.all(np.equal(z, y.samples))
True
>>> y.shape
(100, 4)
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) | Wrapper method to map single samples. |
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: | sensitivity_analyzer: FeaturewiseMeasure :
split_by_labels: str or list of str :
select_common_features: bool :
probablity_label: None or str :
probability_combiner: function :
selector: Selector :
enable_ca : None or list of str
disable_ca : None or list of str
slicearg :
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) | Wrapper method to map single samples. |
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 |
Function used to do selection
Measure which was used to do selection