public class ChainedPredictor<T extends Transformer<T>,P extends Predictor<P>> extends Object implements Predictor<ChainedPredictor<T,P>>, scala.Product, scala.Serializable
Predictor
which represents a pipeline of possibly multiple Transformer
and a trailing
Predictor
.
The ChainedPredictor
can be used as a regular Predictor
. Upon calling the fit method,
the input data is piped through all preceding Transformer
in the pipeline and the resulting
data is given to the trailing Predictor
. The same holds true for the predict operation.
The pipeline mechanism has been inspired by scikit-learn
Constructor and Description |
---|
ChainedPredictor(T transformer,
P predictor) |
Modifier and Type | Method and Description |
---|---|
static <T extends Transformer<T>,P extends Predictor<P>,Testing,Intermediate,PredictionValue> |
chainedEvaluationOperation(TransformDataSetOperation<T,Testing,Intermediate> transformOperation,
EvaluateDataSetOperation<P,Intermediate,PredictionValue> evaluateOperation,
TypeInformation<Testing> testingTypeInformation,
TypeInformation<PredictionValue> predictionValueTypeInformation) |
static <L extends Transformer<L>,R extends Predictor<R>,I,T> |
chainedFitOperation(FitOperation<L,I> fitOperation,
TransformDataSetOperation<L,I,T> transformOperation,
FitOperation<R,T> predictorFitOperation)
FitOperation for the ChainedPredictor . |
static <T extends Transformer<T>,P extends Predictor<P>,Testing,Intermediate,Prediction> |
chainedPredictOperation(TransformDataSetOperation<T,Testing,Intermediate> transformOperation,
PredictDataSetOperation<P,Intermediate,Prediction> predictOperation)
PredictDataSetOperation for the ChainedPredictor . |
P |
predictor() |
T |
transformer() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parameters
public static <T extends Transformer<T>,P extends Predictor<P>,Testing,Intermediate,Prediction> PredictDataSetOperation<ChainedPredictor<T,P>,Testing,Prediction> chainedPredictOperation(TransformDataSetOperation<T,Testing,Intermediate> transformOperation, PredictDataSetOperation<P,Intermediate,Prediction> predictOperation)
PredictDataSetOperation
for the ChainedPredictor
.
The PredictDataSetOperation
requires the TransformDataSetOperation
of the preceding
Transformer
and the PredictDataSetOperation
of the trailing Predictor
. Upon
calling predict, the testing data is first transformed by the preceding Transformer
and
the result is then used to calculate the prediction via the trailing Predictor
.
transformOperation
- TransformDataSetOperation
for the preceding Transformer
predictOperation
- PredictDataSetOperation
for the trailing Predictor
public static <L extends Transformer<L>,R extends Predictor<R>,I,T> FitOperation<ChainedPredictor<L,R>,I> chainedFitOperation(FitOperation<L,I> fitOperation, TransformDataSetOperation<L,I,T> transformOperation, FitOperation<R,T> predictorFitOperation)
FitOperation
for the ChainedPredictor
.
The FitOperation
requires the FitOperation
and the TransformDataSetOperation
of
the preceding Transformer
as well as the FitOperation
of the trailing Predictor
.
Upon calling fit, the preceding Transformer
is first fitted to the training data.
The training data is then transformed by the fitted Transformer
. The transformed data
is then used to fit the Predictor
.
fitOperation
- FitOperation
of the preceding Transformer
transformOperation
- TransformDataSetOperation
of the preceding Transformer
predictorFitOperation
- PredictDataSetOperation
of the trailing Predictor
public static <T extends Transformer<T>,P extends Predictor<P>,Testing,Intermediate,PredictionValue> EvaluateDataSetOperation<ChainedPredictor<T,P>,Testing,PredictionValue> chainedEvaluationOperation(TransformDataSetOperation<T,Testing,Intermediate> transformOperation, EvaluateDataSetOperation<P,Intermediate,PredictionValue> evaluateOperation, TypeInformation<Testing> testingTypeInformation, TypeInformation<PredictionValue> predictionValueTypeInformation)
public T transformer()
public P predictor()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.