T - The class type of the AlgoOperator implementation itselfpublic abstract class AlgoOperator<T extends AlgoOperator<T>> extends Object implements org.apache.flink.ml.api.misc.param.WithParams<T>, HasMLEnvironmentId<T>, Serializable
Base class for the algorithm operators. It hosts the parameters and output tables of an
algorithm operator. Each AlgoOperator may have one or more output tables. One of the output table
is the primary output table which can be obtained by calling getOutput(). The other output
tables are side output tables that can be obtained by calling getSideOutputs().
The input of an AlgoOperator is defined in the subclasses of the AlgoOperator.
ML_ENVIRONMENT_ID| 限定符 | 构造器和说明 |
|---|---|
protected |
AlgoOperator()
Construct the operator with empty Params.
|
protected |
AlgoOperator(org.apache.flink.ml.api.misc.param.Params params)
Construct the operator with the initial Params.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected static void |
checkMinOpSize(int size,
AlgoOperator<?>... inputs) |
protected static void |
checkOpSize(int size,
AlgoOperator<?>... inputs) |
String[] |
getColNames()
Returns the column names of the output table.
|
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getColTypes()
Returns the column types of the output table.
|
org.apache.flink.table.api.Table |
getOutput()
Returns the table held by operator.
|
org.apache.flink.ml.api.misc.param.Params |
getParams() |
org.apache.flink.table.api.TableSchema |
getSchema()
Returns the schema of the output table.
|
String[] |
getSideOutputColNames(int index)
Get the column names of the specified side-output table.
|
org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
getSideOutputColTypes(int index)
Get the column types of the specified side-output table.
|
org.apache.flink.table.api.Table[] |
getSideOutputs()
Returns the side outputs.
|
protected void |
setOutput(org.apache.flink.table.api.Table output)
Set the table held by operator.
|
protected void |
setSideOutputs(org.apache.flink.table.api.Table[] sideOutputs)
Set the side outputs.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMLEnvironmentId, setMLEnvironmentIdprotected AlgoOperator()
This constructor is especially useful when users want to set parameters for the algorithm operators. For example: SplitBatchOp is widely used in ML data pre-processing, which splits one dataset into two dataset: training set and validation set. It is very convenient for us to write code like this:
new SplitBatchOp().setSplitRatio(0.9)
protected AlgoOperator(org.apache.flink.ml.api.misc.param.Params params)
public org.apache.flink.ml.api.misc.param.Params getParams()
getParams 在接口中 org.apache.flink.ml.api.misc.param.WithParams<T extends AlgoOperator<T>>public org.apache.flink.table.api.Table getOutput()
public org.apache.flink.table.api.Table[] getSideOutputs()
protected void setSideOutputs(org.apache.flink.table.api.Table[] sideOutputs)
sideOutputs - the side outputs set the operator.protected void setOutput(org.apache.flink.table.api.Table output)
output - the output table.public String[] getColNames()
public org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getColTypes()
public String[] getSideOutputColNames(int index)
index - the index of the table.public org.apache.flink.api.common.typeinfo.TypeInformation<?>[] getSideOutputColTypes(int index)
index - the index of the table.public org.apache.flink.table.api.TableSchema getSchema()
protected static void checkOpSize(int size,
AlgoOperator<?>... inputs)
protected static void checkMinOpSize(int size,
AlgoOperator<?>... inputs)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.