jsat.clustering.hierarchical
Class SimpleHAC
- java.lang.Object
-
- jsat.clustering.ClustererBase
-
- jsat.clustering.KClustererBase
-
- jsat.clustering.hierarchical.SimpleHAC
-
- All Implemented Interfaces:
- java.io.Serializable, Clusterer, KClusterer
public class SimpleHAC extends KClustererBase
Provides a naive implementation of hierarchical agglomerative clustering (HAC). This means the clustering is built from the bottom up, merging points into clusters. HAC clustering is deterministic. The naive implementation runs in O(n3) time.
NOTE: This implementation does not currently support parallel clustering.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SimpleHAC(ClusterDissimilarity disMeasure)SimpleHAC(SimpleHAC toCopy)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SimpleHACclone()int[]cluster(DataSet dataSet, boolean parallel, int[] designations)Performs clustering on the given data set.int[]cluster(DataSet dataSet, int[] designations)Performs clustering on the given data set.int[]cluster(DataSet dataSet, int clusters, boolean parallel, int[] designations)int[]cluster(DataSet dataSet, int clusters, int[] designations)int[]cluster(DataSet dataSet, int lowK, int highK, boolean parallel, int[] designations)int[]cluster(DataSet dataSet, int lowK, int highK, int[] designations)-
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
-
Methods inherited from interface jsat.clustering.Clusterer
cluster, cluster, supportsWeightedData
-
-
-
-
Constructor Detail
-
SimpleHAC
public SimpleHAC(ClusterDissimilarity disMeasure)
-
SimpleHAC
public SimpleHAC(SimpleHAC toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
cluster
public int[] cluster(DataSet dataSet, 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 ondesignations- 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:
- an array indicating for each value indicating the cluster designation. This is the same array as designations, or a new one if the input array was null
-
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 clusters, int[] designations)
-
cluster
public int[] cluster(DataSet dataSet, int lowK, int highK, boolean parallel, int[] designations)
-
cluster
public int[] cluster(DataSet dataSet, int lowK, int highK, int[] designations)
-
clone
public SimpleHAC clone()
- Specified by:
clonein interfaceClusterer- Specified by:
clonein interfaceKClusterer- Specified by:
clonein classKClustererBase
-
-
DataMelt 3.0 © DataMelt by jWork.ORG