public class KnnModel extends Object implements Model<KnnModel>, KnnModelParams<KnnModel>
Knn
.K
FEATURES_COL
PREDICTION_COL
Constructor and Description |
---|
KnnModel() |
Modifier and Type | Method and Description |
---|---|
org.apache.flink.table.api.Table[] |
getModelData()
Gets a list of tables representing the model data.
|
Map<Param<?>,Object> |
getParamMap()
Returns a map which should contain value for every parameter that meets one of the following
conditions.
|
static KnnModel |
load(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment env,
String path)
Loads model data from path.
|
void |
save(String path)
Saves this stage to the given path.
|
KnnModel |
setModelData(org.apache.flink.table.api.Table... inputs)
Sets model data using the given list of tables.
|
org.apache.flink.table.api.Table[] |
transform(org.apache.flink.table.api.Table... inputs)
Applies the AlgoOperator on the given input tables and returns the result tables.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, getParam, set
getK, setK
getFeaturesCol, setFeaturesCol
getPredictionCol, setPredictionCol
public KnnModel setModelData(org.apache.flink.table.api.Table... inputs)
Model
setModelData
in interface Model<KnnModel>
inputs
- a list of tablespublic org.apache.flink.table.api.Table[] getModelData()
Model
getModelData
in interface Model<KnnModel>
public org.apache.flink.table.api.Table[] transform(org.apache.flink.table.api.Table... inputs)
AlgoOperator
transform
in interface AlgoOperator<KnnModel>
inputs
- a list of tablespublic Map<Param<?>,Object> getParamMap()
WithParams
1) set(...) has been called to set value for this parameter.
2) The parameter is a public final field of this WithParams instance. This includes fields inherited from its interfaces and super-classes.
The subclass which implements this interface could meet this requirement by returning a
member field of the given map type, after having initialized this member field using the
ParamUtils.initializeMapWithDefaultValues(Map, WithParams)
method.
getParamMap
in interface WithParams<KnnModel>
public void save(String path) throws IOException
Stage
save
in interface Stage<KnnModel>
IOException
public static KnnModel load(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment env, String path) throws IOException
env
- Stream execution environment.path
- Model path.IOException
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.