public class EuclideanDistanceCriterionFunction extends java.lang.Object implements CriterionFunction
KMeans.CONF_CRIT_FUN_TERMINATION_VALUE| Constructor and Description |
|---|
EuclideanDistanceCriterionFunction() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClusterMember(RecordInfo member, double[] memberPoint)
Adds the data and point of an individual cluster member.
|
void |
beforeClusterCenterUpdated(int clusterId, double[] clusterCenter, double critFunValue, long memberCount)
Sets the current cluster and its state before the cluster point is updated.
|
void |
clusterCenterUpdated(double[] clusterCenter)
Sets the updated cluster center point
|
double |
getCriterionFunctionValue()
Gets the new criterion function value calculated using the updated cluster center point
|
boolean |
isClusterConverging()
Tell whether the criterion function is converging for the current cluster
|
void |
setup(Configuration conf)
Perform initialization tasks.
|
public void addClusterMember(RecordInfo member, double[] memberPoint)
CriterionFunctionaddClusterMember in interface CriterionFunctionmember - a cluster member as a RecordInfo instancememberPoint - a cluster member point
public void beforeClusterCenterUpdated(int clusterId,
double[] clusterCenter,
double critFunValue,
long memberCount)
CriterionFunctionbeforeClusterCenterUpdated in interface CriterionFunctionclusterId - the cluster idclusterCenter - the cluster center point before updatedcritFunValue - the last criterion function valuememberCount - the number of cluster memberspublic void clusterCenterUpdated(double[] clusterCenter)
CriterionFunctionclusterCenterUpdated in interface CriterionFunctionclusterCenter - the cluster center point ordinatespublic double getCriterionFunctionValue()
CriterionFunctiongetCriterionFunctionValue in interface CriterionFunctionpublic boolean isClusterConverging()
CriterionFunctionisClusterConverging in interface CriterionFunctionpublic void setup(Configuration conf)
CriterionFunctionsetup in interface CriterionFunctionconf - the job configurationCopyright © 2017 Oracle and/or its affiliates. All Rights Reserved.