类 OnlineKMeans
- java.lang.Object
-
- org.apache.flink.ml.clustering.kmeans.OnlineKMeans
-
- 所有已实现的接口:
Serializable,org.apache.flink.ml.api.Estimator<OnlineKMeans,OnlineKMeansModel>,org.apache.flink.ml.api.Stage<OnlineKMeans>,KMeansModelParams<OnlineKMeans>,OnlineKMeansParams<OnlineKMeans>,org.apache.flink.ml.common.param.HasBatchStrategy<OnlineKMeans>,org.apache.flink.ml.common.param.HasDecayFactor<OnlineKMeans>,org.apache.flink.ml.common.param.HasDistanceMeasure<OnlineKMeans>,org.apache.flink.ml.common.param.HasFeaturesCol<OnlineKMeans>,org.apache.flink.ml.common.param.HasGlobalBatchSize<OnlineKMeans>,org.apache.flink.ml.common.param.HasPredictionCol<OnlineKMeans>,org.apache.flink.ml.common.param.HasSeed<OnlineKMeans>,org.apache.flink.ml.param.WithParams<OnlineKMeans>
public class OnlineKMeans extends Object implements org.apache.flink.ml.api.Estimator<OnlineKMeans,OnlineKMeansModel>, OnlineKMeansParams<OnlineKMeans>
OnlineKMeans extends the function ofKMeans, supporting to train a K-Means model continuously according to an unbounded stream of train data.OnlineKMeans makes updates with the "mini-batch" KMeans rule, generalized to incorporate forgetfulness (i.e. decay). After the centroids estimated on the current batch are acquired, OnlineKMeans computes the new centroids from the weighted average between the original and the estimated centroids. The weight of the estimated centroids is the number of points assigned to them. The weight of the original centroids is also the number of points, but additionally multiplying with the decay factor.
The decay factor scales the contribution of the clusters as estimated thus far. If the decay factor is 1, all batches are weighted equally. If the decay factor is 0, new centroids are determined entirely by recent data. Lower values correspond to more forgetting.
- 另请参阅:
- 序列化表格
-
-
字段概要
-
从接口继承的字段 org.apache.flink.ml.clustering.kmeans.KMeansModelParams
K
-
-
构造器概要
构造器 构造器 说明 OnlineKMeans()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 OnlineKMeansModelfit(org.apache.flink.table.api.Table... inputs)Map<org.apache.flink.ml.param.Param<?>,Object>getParamMap()static OnlineKMeansload(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv, String path)voidsave(String path)Saves the metadata AND bounded model data table (if exists) to the given path.OnlineKMeanssetInitialModelData(org.apache.flink.table.api.Table initModelDataTable)Sets the initial model data of the online training process with the provided model data table.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.apache.flink.ml.clustering.kmeans.KMeansModelParams
getK, setK
-
-
-
-
方法详细资料
-
fit
public OnlineKMeansModel fit(org.apache.flink.table.api.Table... inputs)
- 指定者:
fit在接口中org.apache.flink.ml.api.Estimator<OnlineKMeans,OnlineKMeansModel>
-
save
public void save(String path) throws IOException
Saves the metadata AND bounded model data table (if exists) to the given path.- 指定者:
save在接口中org.apache.flink.ml.api.Stage<OnlineKMeans>- 抛出:
IOException
-
load
public static OnlineKMeans load(org.apache.flink.table.api.bridge.java.StreamTableEnvironment tEnv, String path) throws IOException
- 抛出:
IOException
-
getParamMap
public Map<org.apache.flink.ml.param.Param<?>,Object> getParamMap()
- 指定者:
getParamMap在接口中org.apache.flink.ml.param.WithParams<OnlineKMeans>
-
setInitialModelData
public OnlineKMeans setInitialModelData(org.apache.flink.table.api.Table initModelDataTable)
Sets the initial model data of the online training process with the provided model data table.
-
-