T
- The class type of the AlgoOperator
implementation itselfpublic abstract class AlgoOperator<T extends AlgoOperator<T>> extends Object implements 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
Modifier | Constructor and Description |
---|---|
protected |
AlgoOperator()
Construct the operator with empty Params.
|
protected |
AlgoOperator(Params params)
Construct the operator with the initial Params.
|
Modifier and Type | Method and Description |
---|---|
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.
|
TypeInformation<?>[] |
getColTypes()
Returns the column types of the output table.
|
Table |
getOutput()
Returns the table held by operator.
|
Params |
getParams()
Returns the all the parameters.
|
TableSchema |
getSchema()
Returns the schema of the output table.
|
String[] |
getSideOutputColNames(int index)
Get the column names of the specified side-output table.
|
TypeInformation<?>[] |
getSideOutputColTypes(int index)
Get the column types of the specified side-output table.
|
Table[] |
getSideOutputs()
Returns the side outputs.
|
protected void |
setOutput(Table output)
Set the table held by operator.
|
protected void |
setSideOutputs(Table[] sideOutputs)
Set the side outputs.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMLEnvironmentId, setMLEnvironmentId
get, set
protected 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(Params params)
public Params getParams()
WithParams
getParams
in interface WithParams<T extends AlgoOperator<T>>
public Table getOutput()
public Table[] getSideOutputs()
protected void setSideOutputs(Table[] sideOutputs)
sideOutputs
- the side outputs set the operator.protected void setOutput(Table output)
output
- the output table.public String[] getColNames()
public TypeInformation<?>[] getColTypes()
public String[] getSideOutputColNames(int index)
index
- the index of the table.public TypeInformation<?>[] getSideOutputColTypes(int index)
index
- the index of the table.public 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.