|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.util.ClusteringUtils
public final class ClusteringUtils
A class that simplifies clustering when making use of a ClusteringProblem
, a
ClusterableDataSet
and a ClusteringFitnessFunction
.
This
class is not dependent on a ClusteringFitnessFunction
, but the
ClusteringFitnessFunction
s use this class extensively.
Method Summary | |
---|---|
void |
arrangeClustersAndCentroids(Vector centroids)
The three methods called in this method must be called in that specific order, i.e. |
double |
calculateDistance(int x,
int y)
A central point where the cached distance between the two given patterns can be retrieved. |
double |
calculateDistance(Vector lhs,
Vector rhs)
A central point where distances can be calculated. |
static ClusteringUtils |
get()
Return the current instance of this class. |
ArrayList<Vector> |
getArrangedCentroids()
Get the structure that represents the split-up centroids after the non-associated centroids have been removed. |
ArrayList<Hashtable<Integer,ClusterableDataSet.Pattern>> |
getArrangedClusters()
Get the structure that represents the seperate clusters after the empty clusters have been removed. |
ClusterableDataSet |
getClusterableDataSet()
Get the ClusterableDataSet used throughout the current clustering. |
ClusteringProblem |
getClusteringProblem()
Get the ClusteringProblem used throughout the current clustering. |
Vector |
getDataSetMean()
Get the mean Vector that has been cached by the clusterableDataSet . |
double |
getDataSetVariance()
Get the variance (scalar) thas been cached by the clusterableDataSet . |
int |
getNumberOfPatternsInDataSet()
Get the number of patterns in the clusterableDataSet . |
ArrayList<Vector> |
getOriginalCentroids()
Get the structure that represents the split-up centroids before the non-associated centroids were removed. |
ArrayList<Hashtable<Integer,ClusterableDataSet.Pattern>> |
getOriginalClusters()
Get the structure that represents the seperate clusters before the empty clusters were removed. |
ArrayList<ClusterableDataSet.Pattern> |
getPatternsInDataSet()
Get the patterns in the clusterableDataSet . |
void |
setClusterableDataSet(ClusterableDataSet cds)
This class only deals with ClusterableDataSet s. |
void |
setClusteringProblem(ClusteringProblem cp)
This class only deals with ClusteringProblem s. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ClusteringUtils get()
instance
of this class.public void setClusteringProblem(ClusteringProblem cp)
ClusteringProblem
s. Other problems are not
allowed.
cp
- the ClusteringProblem
used throughout the current clusteringpublic ClusteringProblem getClusteringProblem()
ClusteringProblem
used throughout the current clustering.
clusteringProblem
public void setClusterableDataSet(ClusterableDataSet cds)
ClusterableDataSet
s. Other datasets/dataset
builders are not allowed.
cds
- the ClusterableDataSet
used throughout the current clusteringpublic ClusterableDataSet getClusterableDataSet()
ClusterableDataSet
used throughout the current clustering.
clusterableDataSet
public double calculateDistance(Vector lhs, Vector rhs)
lhs
- the one Vector
rhs
- the other Vector
#distanceMeasure
public double calculateDistance(int x, int y)
x
- index of the one patterny
- index of the other pattern
public void arrangeClustersAndCentroids(Vector centroids)
centroids
- the @Vector that represents the centroidspublic ArrayList<ClusterableDataSet.Pattern> getPatternsInDataSet()
clusterableDataSet
.
clusterableDataSet
public int getNumberOfPatternsInDataSet()
clusterableDataSet
.
clusterableDataSet
.public ArrayList<Vector> getOriginalCentroids()
ArrayList
of Vector
s that may contain centroids that are
not associated with any patternspublic ArrayList<Vector> getArrangedCentroids()
ArrayList
of Vector
s that does NOT contain centroids that
are NOT associated with any patternspublic ArrayList<Hashtable<Integer,ClusterableDataSet.Pattern>> getOriginalClusters()
ArrayList
of Hashtable
s that may contain empty clusterspublic ArrayList<Hashtable<Integer,ClusterableDataSet.Pattern>> getArrangedClusters()
ArrayList
of Hashtable
s that does NOT contain empty
clusterspublic Vector getDataSetMean()
Vector
that has been cached by the clusterableDataSet
.
Vector
that represents the mean of all the patterns inside the
clusterableDataSet
public double getDataSetVariance()
clusterableDataSet
.
clusterableDataSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |