public interface Transformer<Self extends Transformer<Self>> extends Estimator<Self>, WithParameters, scala.Serializable
A Transformer transforms a DataSet
of an input type into a DataSet
of an output type.
Furthermore, a Transformer
is also an Estimator
, because some transformations depend
on the training data. In order to do that the implementing class has to provide a
TransformDataSetOperation
and FitOperation
implementation. The Scala compiler finds
these implicit values if it is put in the scope of the companion object of the implementing
class.
Transformer
can be chained with other Transformer
and Predictor
to create
pipelines. These pipelines can consist of an arbitrary number of Transformer
and at most
one trailing Predictor
.
The pipeline mechanism has been inspired by scikit-learn
Modifier and Type | Method and Description |
---|---|
<P extends Predictor<P>> |
chainPredictor(P predictor)
|
<T extends Transformer<T>> |
chainTransformer(T transformer)
Chains two
Transformer to form a ChainedTransformer . |
<Input,Output> |
transform(DataSet<Input> input,
ParameterMap transformParameters,
TransformDataSetOperation<Self,Input,Output> transformOperation)
Transform operation which transforms an input
DataSet of type I into an ouptut DataSet
of type O. |
parameters
<Input,Output> DataSet<Output> transform(DataSet<Input> input, ParameterMap transformParameters, TransformDataSetOperation<Self,Input,Output> transformOperation)
DataSet
of type I into an ouptut DataSet
of type O. The actual transform operation is implemented within the
TransformDataSetOperation
.
input
- Input DataSet
of type ItransformParameters
- Additional parameters for the TransformDataSetOperation
transformOperation
- TransformDataSetOperation
which encapsulates the algorithm's
logic<T extends Transformer<T>> ChainedTransformer<Self,T> chainTransformer(T transformer)
Transformer
to form a ChainedTransformer
.
transformer
- Right side transformer of the resulting pipeline<P extends Predictor<P>> ChainedPredictor<Self,P> chainPredictor(P predictor)
predictor
- Trailing Predictor
of the resulting pipelineCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.