PwTrafoPanelPipeline
Pipeline of transformers and a pairwise panel transformer.
PwTrafoPanelPipeline chains transformers and a pairwise transformer at the end. The pipeline is constructed with a list of sktime transformers (BaseTransformer),
plus a pairwise panel transformer, following BasePairwiseTransformerPanel.
- The transformer list can be unnamed - a simple list of transformers -
or string named - a list of pairs of string, estimator.
For a list of transformers trafo1, trafo2, …, trafoN and an estimator est,
the pipeline behaves as follows:
transform(X)- runningtrafo1.fit_transformonX,them
trafo2.fit_transformon the output oftrafo1.fit_transform, etc sequentially, withtrafo[i]receiving the output oftrafo[i-1]. Then passes output oftrafo[N]topw_trafo.transform, asX. Same chain of transformers is run onX2and passed, if notNone.PwTrafoPanelPipelinecan also be created by using the magic multiplication- on any parameter estimator: if
pw_tisBasePairwiseTransformerPanel, and
my_trafo1,my_trafo2inherit fromBaseTransformer, then, for instance,my_trafo1 * my_trafo2 * pw_twill result in the same object as obtained from the constructorPwTrafoPanelPipeline(pw_trafo=pw_t, transformers=[my_trafo1, my_trafo2])- magic multiplication can also be used with (str, transformer) pairs,
as long as one element in the chain is a transformer
- on any parameter estimator: if
Quickstart
from sktime.dists_kernels.compose import PwTrafoPanelPipeline
estimator = PwTrafoPanelPipeline(pw_trafo, transformers)Parameters(2)
- pw_trafopairwise panel transformer,
i.e., estimator inheriting from BasePairwiseTransformerPanel this is a “blueprint” estimator, state does not change when
fitis called- transformerslist of sktime transformers, or
list of tuples (str, transformer) of sktime transformers these are “blueprint” transformers, states do not change when
fitis called
Examples
>>> from sktime.dists_kernels.compose import PwTrafoPanelPipeline
>>> from sktime.dists_kernels.dtw import DtwDist
>>> from sktime.transformations.exponent import ExponentTransformer
>>> from sktime.datasets import load_unit_test
>>>
>>> X, _ = load_unit_test ()
>>> X = X [0: 3 ]
>>> pipeline = PwTrafoPanelPipeline (DtwDist (), [ExponentTransformer ()])
>>> dist_mat = pipeline. transform (X)