public class E1Function extends BaseFunction
CriterionFunction
measures the external differences between
clusters. It gives a better score to clustering solutions with centroids
that are more distant from the centroid for the data set as a whole.assignments, centroids, clusterSizes, costs, matrix
Constructor and Description |
---|
E1Function()
Constructs a new
E1Function . |
Modifier and Type | Method and Description |
---|---|
protected double |
getNewCentroidScore(int newCentroidIndex,
DoubleVector dataPoint)
Returns the new score for the cluster centroid indexed by
newCentroidIndex when dataPoint is added to it. |
protected double |
getOldCentroidScore(DoubleVector vector,
int oldCentroidIndex,
int altClusterSize)
Returns the new score for the cluster centroid represented by
altCurrentCentroid with the new altClusterSize . |
boolean |
isMaximize()
Returns true if this
CriterionFunction tries to maximize it's
score, and false otherwise. |
protected void |
subSetup(Matrix m)
Setup any extra information needed before computing the cost values for
each cluster.
|
protected void |
updateScores(int newCentroidIndex,
int oldCentroidIndex,
DoubleVector vector) |
assignments, centroids, clusterSizes, modifiedMagnitude, modifiedMagnitudeSqrd, score, setup, subtract, subtractedMagnitude, subtractedMagnitudeSqrd, update
public E1Function()
E1Function
.protected void subSetup(Matrix m)
subSetup
in class BaseFunction
protected double getOldCentroidScore(DoubleVector vector, int oldCentroidIndex, int altClusterSize)
altCurrentCentroid
with the new altClusterSize
.getOldCentroidScore
in class BaseFunction
altClusterSize
- The current updated cluster sizeprotected double getNewCentroidScore(int newCentroidIndex, DoubleVector dataPoint)
newCentroidIndex
when dataPoint
is added to it. Implementations
of this method should not actually add dataPoint
to the centroid,
but should instead use the helper functions provided to compute the new
score.getNewCentroidScore
in class BaseFunction
newCentroidIndex
- The index of the current alternate centroiddataPoint
- The current data point that is being reassignedpublic boolean isMaximize()
CriterionFunction
tries to maximize it's
score, and false otherwise.protected void updateScores(int newCentroidIndex, int oldCentroidIndex, DoubleVector vector)
updateScores
in class BaseFunction
Copyright © 2012. All Rights Reserved.