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
param: transformer Preceding Transformer
of the pipeline
param: predictor Trailing Predictor
of the pipeline
Constructor and Description |
---|
ChainedPredictor(T transformer,
P predictor) |
Modifier and Type | Method and Description |
---|---|
abstract static boolean |
canEqual(Object that) |
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 . |
abstract static boolean |
equals(Object that) |
static <Testing,PredictionValue> |
evaluate(DataSet<Testing> testing,
ParameterMap evaluateParameters,
EvaluateDataSetOperation<Self,Testing,PredictionValue> evaluator) |
static <Testing,PredictionValue> |
evaluate$default$2() |
static <Training> void |
fit(DataSet<Training> training,
ParameterMap fitParameters,
FitOperation<Self,Training> fitOperation) |
static <Training> ParameterMap |
fit$default$2() |
static ParameterMap |
parameters() |
static <Testing,Prediction> |
predict(DataSet<Testing> testing,
ParameterMap predictParameters,
PredictDataSetOperation<Self,Testing,Prediction> predictor) |
static <Testing,Prediction> |
predict$default$2() |
P |
predictor() |
abstract static int |
productArity() |
abstract static Object |
productElement(int n) |
static scala.collection.Iterator<Object> |
productIterator() |
static String |
productPrefix() |
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 static ParameterMap parameters()
public static <Training> void fit(DataSet<Training> training, ParameterMap fitParameters, FitOperation<Self,Training> fitOperation)
public static <Training> ParameterMap fit$default$2()
public static <Testing,Prediction> DataSet<Prediction> predict(DataSet<Testing> testing, ParameterMap predictParameters, PredictDataSetOperation<Self,Testing,Prediction> predictor)
public static <Testing,PredictionValue> DataSet<scala.Tuple2<PredictionValue,PredictionValue>> evaluate(DataSet<Testing> testing, ParameterMap evaluateParameters, EvaluateDataSetOperation<Self,Testing,PredictionValue> evaluator)
public static <Testing,Prediction> ParameterMap predict$default$2()
public static <Testing,PredictionValue> ParameterMap evaluate$default$2()
public abstract static boolean canEqual(Object that)
public abstract static boolean equals(Object that)
public abstract static Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<Object> productIterator()
public static String productPrefix()
public T transformer()
public P predictor()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.