Mapper encapsulating an arbitray MDP flow.
This mapper wraps an MDP flow and uses it for forward and reverse data mapping (reverse is only available if the underlying MDP flow supports it). It is possible to specify arbitrary arguments for the training of the MDP flow.
Because MDP does not allow to ‘reset’ a flow and (re)train it from scratch the mapper uses a copy of the initially wrapped flow for the actual processing. Upon subsequent training attempts a new copy of the original flow is made and replaces the previous one.
Notes
It is not possible to perform incremental training of the MDP flow.
Available conditional attributes:
(Conditional attributes enabled by default suffixed with +)
Examples
>>> import mdp
>>> from mvpa2.mappers.mdp_adaptor import MDPFlowMapper
>>> from mvpa2.base.dataset import DAE
>>> flow = (mdp.nodes.PCANode() + mdp.nodes.IdentityNode() +
... mdp.nodes.FDANode())
>>> mapper = MDPFlowMapper(flow,
... node_arguments=(None, None,
... [DAE('sa', 'targets')]))
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: | flow : mdp.Flow instance
node_arguments : tuple, list
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) | 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 |