|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.functions.Function net.sourceforge.cilib.functions.ContinuousFunction net.sourceforge.cilib.functions.clustering.ClusteringFitnessFunction
public abstract class ClusteringFitnessFunction
This abstract class defines member variables and member functions that can be used by
subclasses to calculate the fitness of a particular clustering in their respective
evaluate methods.
This class makes extensive use of the ClusteringUtils
helper class. The helper
variable is set at the beginning of the
evaluate(Vector)
method so that it can be accessible to the classes that inherit
from this one.
This class makes use of a ClusterCenterStrategy
to enable
the user of this class to specify what is meant by the center of a cluster,
because sometimes the centroid is used and other times the mean is used.
By default, the cluster center is interpreted as the cluster centroid.
Field Summary | |
---|---|
protected ArrayList<Vector> |
arrangedCentroids
|
protected ArrayList<Hashtable<Integer,ClusterableDataSet.Pattern>> |
arrangedClusters
|
protected ClusterCenterStrategy |
clusterCenterStrategy
|
protected int |
clustersFormed
|
protected ClusteringUtils |
helper
|
Constructor Summary | |
---|---|
ClusteringFitnessFunction()
This constructor cannot be called directly since this is an abstract class. |
Method Summary | |
---|---|
double |
calculateAverageIntraClusterDistance()
Calculate the average intra-cluster distance. |
double |
calculateAverageSetDistance(int i,
int j)
Calculate the average distance between two clusters (sets). |
double |
calculateClusterDiameter(int k)
Calculate the diameter of the given cluster, i.e. |
abstract double |
calculateFitness()
|
double |
calculateIntraClusterDistance()
Calculate the intra-cluster distance. |
double |
calculateMaximumAverageDistance()
Calculate the Maximum Average Distance between the patterns in the dataset and the centers learned so far. |
double |
calculateMaximumInterClusterDistance()
Calculate the longest distance between two clusters. |
double |
calculateMaximumSetDistance(int i,
int j)
Calculate the maximum distance between two clusters (sets). |
double |
calculateMinimumInterClusterDistance()
Calculate the shortest distance between two clusters. |
double |
calculateMinimumSetDistance(int i,
int j)
Calculate the minimum distance between two clusters (sets). |
double |
calculateQuantisationError()
Calculate the Quantisation Error. |
double |
evaluate(Vector centroids)
This method is responsible for various things before the fitness can be returned: Arrange the patterns in the dataset to belong to its closest centroid. |
abstract ClusteringFitnessFunction |
getClone()
Create a cloned copy of the current object and return it. |
Double |
getMaximum()
Accessor for the function maximum. |
Double |
getMinimum()
Accessor for the function minimum. |
void |
setClusterCenterStrategy(ClusterCenterStrategy ccs)
|
protected double |
validateFitness(double fitness)
This method logs the cases when the fitness is less than zero. |
protected Double |
worstFitness()
|
Methods inherited from class net.sourceforge.cilib.functions.ContinuousFunction |
---|
evaluate |
Methods inherited from class net.sourceforge.cilib.functions.Function |
---|
getBehavioralDomainRegistry, getDimension, getDomain, getDomainRegistry, setBehavioralDomain, setBehaviouralDomainRegistry, setDomain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClusteringUtils helper
protected ClusterCenterStrategy clusterCenterStrategy
protected ArrayList<Hashtable<Integer,ClusterableDataSet.Pattern>> arrangedClusters
protected ArrayList<Vector> arrangedCentroids
protected int clustersFormed
Constructor Detail |
---|
public ClusteringFitnessFunction()
ClusteringProblem
.
Method Detail |
---|
public abstract ClusteringFitnessFunction getClone()
ContinuousFunction
getClone
in interface Cloneable
getClone
in class ContinuousFunction
Object.clone()
public double evaluate(Vector centroids)
ClusteringUtils.arrangeClustersAndCentroids(Vector)
method. We also assume
that this method removes empty clusters and their associated centroids from the
arranged listsarrangedClusters
member variable which is available to
sub-classes.arrangedCentroids
member variable which is available to
sub-classes.calculateFitness()
method>= 0.0
.
evaluate
in class ContinuousFunction
centroids
- The Vector
representing the centroid vectors
public abstract double calculateFitness()
public double calculateQuantisationError()
This is explained in Section 4.1.1 on pages 104 & 105 of:
public double calculateMaximumAverageDistance()
See Section 4.1.1 at the bottom of page 105 of:
public double calculateMinimumInterClusterDistance()
public double calculateMaximumInterClusterDistance()
public double calculateMinimumSetDistance(int i, int j)
This is illustrated in Equation 20 of:
i
- the index of the LHS clusterj
- the index of the RHS cluster
public double calculateMaximumSetDistance(int i, int j)
Illustrated in Equation 21 of:
i
- the index of the LHS cluster.j
- the index of the RHS cluster.
public double calculateAverageSetDistance(int i, int j)
Illustrated in Equation 22 of:
i
- the index of the LHS cluster.j
- the index of the RHS cluster.
public double calculateClusterDiameter(int k)
k
- the index of the cluster for which the diameter should be calculated.
public double calculateIntraClusterDistance()
public double calculateAverageIntraClusterDistance()
public void setClusterCenterStrategy(ClusterCenterStrategy ccs)
public Double getMinimum()
ContinuousFunction
getMinimum
in class ContinuousFunction
public Double getMaximum()
ContinuousFunction
getMaximum
in class ContinuousFunction
protected Double worstFitness()
protected double validateFitness(double fitness)
fitness
- the fitness value that will be validated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |