public class SquaredErrorCriterionFunction extends java.lang.Object implements CriterionFunction
CriterionFunction
implementation that uses a squared error criterion function.Constructor and Description |
---|
SquaredErrorCriterionFunction() |
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)
CriterionFunction
addClusterMember
in interface CriterionFunction
member
- a cluster member as a RecordInfo instancememberPoint
- a cluster member pointpublic void beforeClusterCenterUpdated(int clusterId, double[] clusterCenter, double critFunValue, long memberCount)
CriterionFunction
beforeClusterCenterUpdated
in interface CriterionFunction
clusterId
- the cluster idclusterCenter
- the cluster center point before updatedcritFunValue
- the last criterion function valuememberCount
- the number of cluster memberspublic void clusterCenterUpdated(double[] clusterCenter)
CriterionFunction
clusterCenterUpdated
in interface CriterionFunction
clusterCenter
- the cluster center point ordinatespublic double getCriterionFunctionValue()
CriterionFunction
getCriterionFunctionValue
in interface CriterionFunction
public boolean isClusterConverging()
CriterionFunction
isClusterConverging
in interface CriterionFunction
public void setup(Configuration conf)
CriterionFunction
setup
in interface CriterionFunction
conf
- the job configurationCopyright © 2017 Oracle and/or its affiliates. All Rights Reserved.