jsat.clustering
Class HDBSCAN
- java.lang.Object
-
- jsat.clustering.HDBSCAN
-
- All Implemented Interfaces:
- java.io.Serializable, Clusterer, Parameterized
public class HDBSCAN extends java.lang.Object implements Clusterer, Parameterized
HDBSCAN is a density based clustering algorithm that is an improvement overDBSCAN. Unlike its predecessor, HDBSCAN works with variable density datasets and does not need a search radius to be specified. The original paper presents HDBSCAN with two parametersmptsandmclSize, but recomends that they can be set to the same value and effectively behave as if only one parameter exists. This implementation allows for setting both independtly, but the single parameter constructors will use the same value for both parameters.
NOTE: The current implementation has O(N2) run time, though this may be improved in the future with more advanced algorithms.
See: Campello, R. J. G. B., Moulavi, D., & Sander, J. (2013). Density-Based Clustering Based on Hierarchical Density Estimates. In J. Pei, V. Tseng, L. Cao, H. Motoda, & G. Xu (Eds.), Advances in Knowledge Discovery and Data Mining (pp. 160–172). Springer Berlin Heidelberg. doi:10.1007/978-3-642-37456-2_14- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description HDBSCAN()Creates a new HDBSCAN object using a threshold of 15 points to form a cluster.HDBSCAN(DistanceMetric dm, int m_pts)Creates a new HDBSCAN using the simplified form, where the only parameter is a single value.HDBSCAN(DistanceMetric dm, int m_pts, int m_clSize, VectorCollection<Vec> vc)Creates a new HDBSCAN using the full specification of the algorithm, where two parameters may be altered.HDBSCAN(DistanceMetric dm, int m_pts, VectorCollection<Vec> vcf)Creates a new HDBSCAN using the simplified form, where the only parameter is a single value.HDBSCAN(HDBSCAN toCopy)Copy constructorHDBSCAN(int m_pts)Creates a new HDBSCAN using the simplified form, where the only parameter is a single value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description HDBSCANclone()int[]cluster(DataSet dataSet, boolean parallel, int[] designations)Performs clustering on the given data set.DistanceMetricgetDistanceMetrics()intgetMinClusterSize()intgetMinPoints()voidsetDistanceMetrics(DistanceMetric dm)Sets the distance metric to use for determining closeness between data pointsvoidsetMinClusterSize(int m_clSize)voidsetMinPoints(int m_pts)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.clustering.Clusterer
cluster, cluster, cluster, supportsWeightedData
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
HDBSCAN
public HDBSCAN()
Creates a new HDBSCAN object using a threshold of 15 points to form a cluster.
-
HDBSCAN
public HDBSCAN(int m_pts)
Creates a new HDBSCAN using the simplified form, where the only parameter is a single value.- Parameters:
m_pts- the minimum number of points needed to form a cluster and the number of neighbors to consider
-
HDBSCAN
public HDBSCAN(DistanceMetric dm, int m_pts)
Creates a new HDBSCAN using the simplified form, where the only parameter is a single value.- Parameters:
dm- the distance metric to use for finding nearest neighborsm_pts- the minimum number of points needed to form a cluster and the number of neighbors to consider
-
HDBSCAN
public HDBSCAN(DistanceMetric dm, int m_pts, VectorCollection<Vec> vcf)
Creates a new HDBSCAN using the simplified form, where the only parameter is a single value.- Parameters:
dm- the distance metric to use for finding nearest neighborsm_pts- the minimum number of points needed to form a cluster and the number of neighbors to considervcf- the vector collection to use for accelerating nearest neighbor queries
-
HDBSCAN
public HDBSCAN(DistanceMetric dm, int m_pts, int m_clSize, VectorCollection<Vec> vc)
Creates a new HDBSCAN using the full specification of the algorithm, where two parameters may be altered. In the simplified version both parameters always have the same value.- Parameters:
dm- the distance metric to use for finding nearest neighborsm_pts- the number of neighbors to consider, acts as a smoothing over the density estimatem_clSize- the minimum number of data points needed to form a clustervc- the vector collection to use for accelerating nearest neighbor queries
-
HDBSCAN
public HDBSCAN(HDBSCAN toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
setMinClusterSize
public void setMinClusterSize(int m_clSize)
- Parameters:
m_clSize- the minimum number of data points needed to form a cluster
-
getMinClusterSize
public int getMinClusterSize()
- Returns:
- the minimum number of data points needed to form a cluster
-
setDistanceMetrics
public void setDistanceMetrics(DistanceMetric dm)
Sets the distance metric to use for determining closeness between data points- Parameters:
dm- the distance metric to determine nearest neighbors with
-
getDistanceMetrics
public DistanceMetric getDistanceMetrics()
- Returns:
- the distance metric to determine nearest neighbors with
-
setMinPoints
public void setMinPoints(int m_pts)
- Parameters:
m_pts- the number of neighbors to consider, acts as a smoothing over the density estimate
-
getMinPoints
public int getMinPoints()
- Returns:
- the number of neighbors to consider, acts as a smoothing over the density estimate
-
clone
public HDBSCAN clone()
-
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.- Specified by:
clusterin interfaceClusterer- 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[]
-
-
DataMelt 3.0 © DataMelt by jWork.ORG