public class AgglomerativeClustering extends Object implements AlgoOperator<AgglomerativeClustering>, AgglomerativeClusteringParams<AgglomerativeClustering>
AgglomerativeClusteringParams.LINKAGE
and different distance measures by setting HasDistanceMeasure.DISTANCE_MEASURE
.
The output contains two tables. The first one assigns one cluster Id for each data point. The second one contains the information of merging two clusters at each step. The data format of the merging information is (clusterId1, clusterId2, distance, sizeOfMergedCluster).
This AlgoOperator splits input stream into mini-batches of elements according to the windowing
strategy specified by the HasWindows
parameter, and
performs the hierarchical clustering on each mini-batch independently. The clustering result of
each element depends only on the elements in the same mini-batch.
See https://en.wikipedia.org/wiki/Hierarchical_clustering.
COMPUTE_FULL_TREE, DISTANCE_THRESHOLD, LINKAGE, LINKAGE_AVERAGE, LINKAGE_COMPLETE, LINKAGE_SINGLE, LINKAGE_WARD, NUM_CLUSTERS
DISTANCE_MEASURE
FEATURES_COL
PREDICTION_COL
WINDOWS
Constructor and Description |
---|
AgglomerativeClustering() |
Modifier and Type | Method and Description |
---|---|
Map<Param<?>,Object> |
getParamMap()
Returns a map which should contain value for every parameter that meets one of the following
conditions.
|
static AgglomerativeClustering |
load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv,
String path) |
void |
save(String path)
Saves the metadata and bounded data of this stage to the given path.
|
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
getComputeFullTree, getDistanceThreshold, getLinkage, getNumClusters, setComputeFullTree, setDistanceThreshold, setLinkage, setNumClusters
getDistanceMeasure, setDistanceMeasure
getFeaturesCol, setFeaturesCol
getPredictionCol, setPredictionCol
getWindows, setWindows
get, getParam, set
public org.apache.flink.table.api.Table[] transform(org.apache.flink.table.api.Table... inputs)
AlgoOperator
transform
in interface AlgoOperator<AgglomerativeClustering>
inputs
- a list of tablespublic void save(String path) throws IOException
Stage
save
in interface Stage<AgglomerativeClustering>
IOException
public static AgglomerativeClustering load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv, String path) throws IOException
IOException
public 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<AgglomerativeClustering>
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.