public class KMeans extends Object implements Estimator<KMeans,KMeansModel>, KMeansParams<KMeans>
See https://en.wikipedia.org/wiki/K-means_clustering.
INIT_MODE
MAX_ITER
K
DISTANCE_MEASURE
FEATURES_COL
PREDICTION_COL
Constructor and Description |
---|
KMeans() |
Modifier and Type | Method and Description |
---|---|
KMeansModel |
fit(org.apache.flink.table.api.Table... inputs)
Trains on the given inputs and produces a Model.
|
Map<Param<?>,Object> |
getParamMap()
Returns a map which should contain value for every parameter that meets one of the following
conditions.
|
static KMeans |
load(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment env,
String path) |
void |
save(String path)
Saves this stage to the given path.
|
static org.apache.flink.streaming.api.datastream.DataStream<DenseVector[]> |
selectRandomCentroids(org.apache.flink.streaming.api.datastream.DataStream<DenseVector> data,
int k,
long seed) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInitMode, setInitMode
getMaxIter, setMaxIter
getK, setK
getDistanceMeasure, setDistanceMeasure
getFeaturesCol, setFeaturesCol
getPredictionCol, setPredictionCol
get, getParam, set
public KMeansModel fit(org.apache.flink.table.api.Table... inputs)
Estimator
fit
in interface Estimator<KMeans,KMeansModel>
inputs
- a list of tablespublic void save(String path) throws IOException
Stage
save
in interface Stage<KMeans>
IOException
public static KMeans load(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment env, 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<KMeans>
public static org.apache.flink.streaming.api.datastream.DataStream<DenseVector[]> selectRandomCentroids(org.apache.flink.streaming.api.datastream.DataStream<DenseVector> data, int k, long seed)
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.