jsat.clustering.hierarchical
Class PriorityHAC
- java.lang.Object
-
- jsat.clustering.ClustererBase
-
- jsat.clustering.KClustererBase
-
- jsat.clustering.hierarchical.PriorityHAC
-
- All Implemented Interfaces:
- java.io.Serializable, Clusterer, KClusterer
public class PriorityHAC extends KClustererBase
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PriorityHAC(PriorityHAC toCopy)Copy constructorPriorityHAC(UpdatableClusterDissimilarity dissMeasure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description PriorityHACclone()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)java.util.List<java.util.List<DataPoint>>getClusterDesignations(int clusters)Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters.int[]getClusterDesignations(int[] designations, int clusters)Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters.booleanhasStoredClustering()The PriorityHAC stores its merging order, so that multiple clusterings can of different sizes can be obtained without having to recluster the 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
-
Methods inherited from interface jsat.clustering.Clusterer
cluster, cluster, supportsWeightedData
-
-
-
-
Constructor Detail
-
PriorityHAC
public PriorityHAC(UpdatableClusterDissimilarity dissMeasure)
-
PriorityHAC
public PriorityHAC(PriorityHAC 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)
-
hasStoredClustering
public boolean hasStoredClustering()
The PriorityHAC stores its merging order, so that multiple clusterings can of different sizes can be obtained without having to recluster the data set. This is possible in part because HAC is deterministic.
This returns true if there is currently a data set and its merge order stored.- Returns:
- true if you can call for more clusterings, false if no data set has been clustered.
-
getClusterDesignations
public int[] getClusterDesignations(int[] designations, int clusters)Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters.- Parameters:
designations- the array to store the assignments inclusters- the number of clusters desired- Returns:
- the original array passed in, or null if no data set has been clustered.
- See Also:
hasStoredClustering()
-
getClusterDesignations
public java.util.List<java.util.List<DataPoint>> getClusterDesignations(int clusters)
Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters.- Parameters:
clusters- the number of clusters desired- Returns:
- the list of data points in each cluster, or null if no data set has been clustered.
- See Also:
hasStoredClustering()
-
clone
public PriorityHAC clone()
- Specified by:
clonein interfaceClusterer- Specified by:
clonein interfaceKClusterer- Specified by:
clonein classKClustererBase
-
-
DataMelt 3.0 © DataMelt by jWork.ORG