|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.clustering.WardClustering<E>
public class WardClustering<E>
Nested Class Summary | |
---|---|
(package private) class |
WardClustering.ClusterThread
|
Field Summary | |
---|---|
protected double[] |
clusterLevelMergeCosts
|
protected ArrayList<HierarchicalCluster<E>>[] |
clusterLevels
|
protected List<HierarchicalCluster<E>> |
clusters
Stores the clusters; starts from being a list of clusters containing only one element (n elements), up to a final set of clusters; there will be at least one single cluster containing all elements (if the targetSize or
threshold permit that), or potentially any other number m <= n. |
protected boolean |
debug
Turn on some debugging |
private CountDownLatch |
doneSignal
|
private ThreadPoolExecutor |
e
|
protected ClusterElementFunctions<E> |
elementDistance
|
private int |
numberOfCPUs
|
protected int |
targetSize
|
protected double |
threshold
|
Constructor Summary | |
---|---|
WardClustering(ClusterElementFunctions<E> elementDistance)
Do full clustering tree. |
|
WardClustering(ClusterElementFunctions<E> elementDistance,
double threshold)
Do clustering with a specified threshold to stop building the tree. |
|
WardClustering(ClusterElementFunctions<E> elementDistance,
int targetSize)
Do clustering with a specified target number of clusters to reach. |
Method Summary | |
---|---|
HierarchicalCluster<E> |
clusterStep(List<HierarchicalCluster<E>> clusters)
|
List<HierarchicalCluster<E>> |
doCluster(List<E> data)
|
double |
ess(Cluster<E> cluster)
|
private HierarchicalCluster<E> |
findOptiomalClusterMerger(List<HierarchicalCluster<E>> clusters)
|
private HierarchicalCluster<E> |
findOptiomalClusterMerger(List<HierarchicalCluster<E>> clusters,
int startX,
int startY,
int endX,
int endY)
|
List<HierarchicalCluster<E>> |
getClusters()
|
HashMap<Integer,ArrayList<HierarchicalCluster<E>>> |
getClustersAtLevel()
Returns the clusters at all levels |
ArrayList<HierarchicalCluster<E>> |
getClustersAtLevel(int num)
Returns the clustering at a certain level, where the level equals the number of clusters |
ArrayList<HierarchicalCluster<E>> |
getClustersByRelativeThreshold(double percent)
Returns the clustering at a certain level indicated by the relative merge cost for that level, compared to the costs of merging all data items |
ArrayList<HierarchicalCluster<E>> |
getClustersByThreshold(double threshold)
Returns the clustering at a certain level indicated by the merge cost for that level |
private Indices2D[] |
getIndices(List<HierarchicalCluster<E>> clusters)
find matrix indices for starting & ending the symmetrical matrix indices |
double |
getInitialMinESS(List<HierarchicalCluster<E>> clusters)
|
prefuse.data.Tree |
getPrefuseTree()
|
protected void |
init(List<E> data)
|
void |
setDebug(boolean debug)
|
void |
setNumberOfCPUs(int numberOfCPUs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int numberOfCPUs
private CountDownLatch doneSignal
private ThreadPoolExecutor e
protected ArrayList<HierarchicalCluster<E>>[] clusterLevels
protected double[] clusterLevelMergeCosts
protected ClusterElementFunctions<E> elementDistance
protected double threshold
protected int targetSize
protected List<HierarchicalCluster<E>> clusters
targetSize
or
threshold
permit that), or potentially any other number m <= n. Intermediate results, with numbers of
clusters l, m < l < n, are stored in #clusterLevels.
protected boolean debug
Constructor Detail |
---|
public WardClustering(ClusterElementFunctions<E> elementDistance)
public WardClustering(ClusterElementFunctions<E> elementDistance, double threshold)
public WardClustering(ClusterElementFunctions<E> elementDistance, int targetSize)
Method Detail |
---|
public prefuse.data.Tree getPrefuseTree()
getPrefuseTree
in interface HierarchicalClusteringAlgorithm<E>
public List<HierarchicalCluster<E>> doCluster(List<E> data)
doCluster
in interface ClusteringAlgorithm<E>
protected void init(List<E> data)
public double getInitialMinESS(List<HierarchicalCluster<E>> clusters)
public double ess(Cluster<E> cluster)
public HierarchicalCluster<E> clusterStep(List<HierarchicalCluster<E>> clusters)
private HierarchicalCluster<E> findOptiomalClusterMerger(List<HierarchicalCluster<E>> clusters)
private HierarchicalCluster<E> findOptiomalClusterMerger(List<HierarchicalCluster<E>> clusters, int startX, int startY, int endX, int endY)
public ArrayList<HierarchicalCluster<E>> getClustersByThreshold(double threshold) throws SOMToolboxException
SOMToolboxException
public ArrayList<HierarchicalCluster<E>> getClustersByRelativeThreshold(double percent) throws SOMToolboxException
SOMToolboxException
public ArrayList<HierarchicalCluster<E>> getClustersAtLevel(int num) throws SOMToolboxException
getClustersAtLevel
in interface HierarchicalClusteringAlgorithm<E>
SOMToolboxException
public HashMap<Integer,ArrayList<HierarchicalCluster<E>>> getClustersAtLevel() throws SOMToolboxException
HierarchicalClusteringAlgorithm
getClustersAtLevel
in interface HierarchicalClusteringAlgorithm<E>
SOMToolboxException
public void setDebug(boolean debug)
public void setNumberOfCPUs(int numberOfCPUs)
private Indices2D[] getIndices(List<HierarchicalCluster<E>> clusters)
public List<HierarchicalCluster<E>> getClusters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |