Mapper to execute a callable with two datasets as arguments.
The first dataset is passed to the mapper during training, the second dataset is passed to forward/call(). This mapper is useful to, for example, compare two datasets regarding particular aspects, merge them, or perform other operations that require the presence of two datasets.
Notes
Available conditional attributes:
(Conditional attributes enabled by default suffixed with +)
Parameters : | fx : callable
train_as_1st : bool
enable_ca : None or list of str
disable_ca : None or list of str
auto_train : bool
force_train : bool
space: str, optional :
postproc : Node instance, optional
descr : str
|
---|
Examples
>>> from mvpa2.mappers.fxy import FxyMapper
>>> from mvpa2.datasets import Dataset
>>> callable = lambda x,y: len(x) > len(y)
>>> ds1 = Dataset(range(5))
>>> ds2 = Dataset(range(3))
>>> fxy = FxyMapper(callable)
>>> fxy.train(ds1)
>>> fxy(ds2).item()
True
>>> fxy = FxyMapper(callable, train_as_1st=False)
>>> fxy.train(ds1)
>>> fxy(ds2).item()
False