public class I2Function extends BaseFunction
CriterionFunction
measures the amount of internal similarity for
each computed centroid. Centroids with higher internal similarity are given
higher scores. It uses the magnitude of each centroid as the basis for this
measurement.assignments, centroids, clusterSizes, costs, matrix
Constructor and Description |
---|
I2Function()
Constructs a new
I2Function . |
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. |
assignments, centroids, clusterSizes, modifiedMagnitude, modifiedMagnitudeSqrd, score, setup, subSetup, subtract, subtractedMagnitude, subtractedMagnitudeSqrd, update, updateScores
public I2Function()
I2Function
.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.Copyright © 2012. All Rights Reserved.