jsat.clustering.hierarchical
Class DivisiveGlobalClusterer
- java.lang.Object
-
- jsat.clustering.ClustererBase
-
- jsat.clustering.KClustererBase
-
- jsat.clustering.hierarchical.DivisiveGlobalClusterer
-
- All Implemented Interfaces:
- java.io.Serializable, Clusterer, KClusterer
public class DivisiveGlobalClusterer extends KClustererBase
DivisiveGlobalClusterer is a hierarchical clustering method that works by splitting the data set into sub trees from the top down. Unlike many top-up methods, such asSimpleHAC, top-down methods require another clustering method to perform the splitting at each iteration. If the base method is not deterministic, then the top-down method will not be deterministic.
Like many HAC methods, DivisiveGlobalClusterer will store the merge order of the clusters so that the clustering results for many k can be obtained. It is limited to the range of clusters successfully computed before.
Specifically, DivisiveGlobalClusterer greedily chooses the cluster to split based on an evaluation of all resulting clusters after a split. Because of this global search of the world, DivisiveLocalClusterer has can make a good estimate of the number of clusters in the data set. The quality of this result is dependent on the accuracy of theClusterEvaluationused. This quality comes at the cost of execution speed, as more and more large evaluations of the whole dataset are needed at each iteration. If execution speed is more important,DivisiveLocalClusterershould be used instead, which requires only a fixed number of evaluations per iteration.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DivisiveGlobalClusterer(DivisiveGlobalClusterer toCopy)Copy constructorDivisiveGlobalClusterer(KClusterer baseClusterer, ClusterEvaluation clusterEvaluation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DivisiveGlobalClustererclone()int[]cluster(DataSet dataSet, boolean parallel, int[] designations)Performs clustering on the given data set.int[]cluster(DataSet dataSet, int clusters, boolean parallel, int[] designations)int[]cluster(DataSet dataSet, int lowK, int highK, boolean parallel, int[] designations)int[]clusterSplit(int targetK)Returns the clustering results for a specific k number of clusters for a previously computed data set.-
Methods inherited from class jsat.clustering.ClustererBase
createClusterListFromAssignmentArray, getDatapointsFromCluster
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.clustering.KClusterer
cluster, cluster, cluster, cluster, cluster, cluster
-
Methods inherited from interface jsat.clustering.Clusterer
cluster, cluster, cluster, supportsWeightedData
-
-
-
-
Constructor Detail
-
DivisiveGlobalClusterer
public DivisiveGlobalClusterer(KClusterer baseClusterer, ClusterEvaluation clusterEvaluation)
-
DivisiveGlobalClusterer
public DivisiveGlobalClusterer(DivisiveGlobalClusterer toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
cluster
public int[] cluster(DataSet dataSet, boolean parallel, int[] designations)
Description copied from interface:ClustererPerforms clustering on the given data set. Parameters may be estimated by the method, or other heuristics performed.- Parameters:
dataSet- the data set to perform clustering onparallel-trueif multiple threads should be used to perform clustering.falseif it should be done in a single threaded manner.designations- the array which will contain the designated values. The array will be altered and returned by the function. If null is given, a new array will be created and returned.- Returns:
- the int[]
-
cluster
public int[] cluster(DataSet dataSet, int clusters, boolean parallel, int[] designations)
-
cluster
public int[] cluster(DataSet dataSet, int lowK, int highK, boolean parallel, int[] designations)
-
clusterSplit
public int[] clusterSplit(int targetK)
Returns the clustering results for a specific k number of clusters for a previously computed data set. If the data set did not compute up to the value k null will be returned.- Parameters:
targetK- the number of clusters to get the result for.- Returns:
- an array containing the assignments for each cluster in the original data set.
- Throws:
ClusterFailureException- if no prior data set had been clustered
-
clone
public DivisiveGlobalClusterer clone()
- Specified by:
clonein interfaceClusterer- Specified by:
clonein interfaceKClusterer- Specified by:
clonein classKClustererBase
-
-
DataMelt 3.0 © DataMelt by jWork.ORG