@PublicEvolving public final class Pipeline extends Object implements Estimator<Pipeline,Pipeline>, Transformer<Pipeline>, Model<Pipeline>
Transformers to execute an algorithm.
A pipeline itself can either act as an Estimator or a Transformer, depending on the stages it includes. More specifically:
Estimator, one needs to call
fit(TableEnvironment, Table)before use the pipeline as a
Transformer. In this case the Pipeline is an
Estimatorand can produce a Pipeline as a
Estimator, it is a
Transformerand can be applied to a Table directly. In this case,
fit(TableEnvironment, Table)will simply return the pipeline itself.
|Constructor and Description|
|Modifier and Type||Method and Description|
Appends a PipelineStage to the tail of this pipeline.
Train the pipeline to fit on the records in the given
Returns the all the parameters.
Returns a list of all stages in this pipeline in order, the list is immutable.
Check whether the pipeline acts as an
Generate a result table by applying all the stages in this pipeline to the input table in order.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Pipeline(String pipelineJson)
public Pipeline(List<org.apache.flink.ml.api.core.PipelineStage> stages)
public Pipeline appendStage(org.apache.flink.ml.api.core.PipelineStage stage)
stage- the stage to be appended
public List<org.apache.flink.ml.api.core.PipelineStage> getStages()
public boolean needFit()
Estimatoror not. When the return value is true, that means this pipeline contains an
Estimatorand thus users must invoke
fit(TableEnvironment, Table)before they can use this pipeline as a
Transformer. Otherwise, the pipeline can be used as a
trueif this pipeline has an Estimator,
public Params getParams()
public Pipeline fit(TableEnvironment tEnv, Table input)
This method go through all the
PipelineStages in order and does the following
on each stage until the last
Estimator.fit(TableEnvironment, Table)with the input table to generate a
Model, transform the the input table with the generated
Modelto get a result table, then pass the result table to the next stage as input.
Transformer.transform(TableEnvironment, Table)on the input table to get a result table, and pass the result table to the next stage as input.
After all the
Estimators are trained to fit their input tables, a new
pipeline will be created with the same stages in this pipeline, except that all the
Estimators in the new pipeline are replaced with their corresponding Models generated in the
If there is no
Estimator in the pipeline, the method returns a copy of this
tEnv- the table environment to which the input table is bound.
input- the table with records to train the Pipeline.
public Table transform(TableEnvironment tEnv, Table input)
public String toJson()
public void loadJson(String json)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.