jsat.clustering
Class LSDBC
- java.lang.Object
-
- jsat.clustering.ClustererBase
-
- jsat.clustering.LSDBC
-
- All Implemented Interfaces:
- java.io.Serializable, Clusterer, Parameterized
public class LSDBC extends ClustererBase implements Parameterized
A parallel implementation of Locally Scaled Density Based Clustering.
See paper:
Biçici, E., &Yuret, D. (2007). Locally scaled density based clustering. In B. Beliczynski, A. Dzielinski, M. Iwanowski,&B. Ribeiro (Eds.), Adaptive and Natural Computing Algorithms (pp. 739–748). Warsaw, Poland: Springer-Verlag.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleDEFAULT_ALPHA4.0 is the default scale value used when performing clustering.static intDEFAULT_NEIGHBORS15 is the default number of neighbors used when performing clustering
-
Constructor Summary
Constructors Constructor and Description LSDBC()Creates a new LSDBC clustering object using theEuclideanDistanceand default parameter values.LSDBC(DistanceMetric dm)Creates a new LSDBC clustering object using the given distance metricLSDBC(DistanceMetric dm, double alpha)Creates a new LSDBC clustering object using the given distance metricLSDBC(DistanceMetric dm, double alpha, int neighbors)Creates a new LSDBC clustering object using the given distance metricLSDBC(LSDBC toCopy)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description LSDBCclone()int[]cluster(DataSet dataSet, boolean parallel, int[] designations)Performs clustering on the given data set.doublegetAlpha()Returns the scale value that will control how many points are added to a cluster.intgetNeighbors()Returns the number of neighbors that will be considered when clustering data pointsvoidsetAlpha(double alpha)Sets the scale value that will control how many points are added to a cluster.voidsetDistanceMetric(DistanceMetric dm)Sets the distance metric used when performing clustering.voidsetNeighbors(int neighbors)Sets the number of neighbors that will be considered when clustering data pointsvoidsetVectorCollectionFactory(VectorCollection<VecPaired<Vec,java.lang.Integer>> vc)Sets the vector collection factory used for acceleration of neighbor searches.-
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.parameters.Parameterized
getParameter, getParameters
-
Methods inherited from interface jsat.clustering.Clusterer
cluster, cluster, cluster, supportsWeightedData
-
-
-
-
Field Detail
-
DEFAULT_NEIGHBORS
public static final int DEFAULT_NEIGHBORS
15 is the default number of neighbors used when performing clustering- See Also:
setNeighbors(int), Constant Field Values
-
DEFAULT_ALPHA
public static final double DEFAULT_ALPHA
4.0 is the default scale value used when performing clustering.- See Also:
setAlpha(double), Constant Field Values
-
-
Constructor Detail
-
LSDBC
public LSDBC(DistanceMetric dm, double alpha, int neighbors)
Creates a new LSDBC clustering object using the given distance metric- Parameters:
dm- the distance metric to usealpha- the scale factor to use when forming clustersneighbors- the number of neighbors to consider when determining clusters
-
LSDBC
public LSDBC(DistanceMetric dm, double alpha)
Creates a new LSDBC clustering object using the given distance metric- Parameters:
dm- the distance metric to usealpha- the scale factor to use when forming clusters
-
LSDBC
public LSDBC(DistanceMetric dm)
Creates a new LSDBC clustering object using the given distance metric- Parameters:
dm- the distance metric to use
-
LSDBC
public LSDBC()
Creates a new LSDBC clustering object using theEuclideanDistanceand default parameter values.
-
LSDBC
public LSDBC(LSDBC toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
setVectorCollectionFactory
public void setVectorCollectionFactory(VectorCollection<VecPaired<Vec,java.lang.Integer>> vc)
Sets the vector collection factory used for acceleration of neighbor searches.- Parameters:
vc- the vector collection to use
-
setDistanceMetric
public void setDistanceMetric(DistanceMetric dm)
Sets the distance metric used when performing clustering.- Parameters:
dm- the distance metric to use.
-
setNeighbors
public void setNeighbors(int neighbors)
Sets the number of neighbors that will be considered when clustering data points- Parameters:
neighbors- the number of neighbors the algorithm will use
-
getNeighbors
public int getNeighbors()
Returns the number of neighbors that will be considered when clustering data points- Returns:
- the number of neighbors the algorithm will use
-
setAlpha
public void setAlpha(double alpha)
Sets the scale value that will control how many points are added to a cluster. Smaller values will create more, smaller clusters - and more points will be labeled as noise. Larger values causes larger and fewer clusters.- Parameters:
alpha- the scale value to use
-
getAlpha
public double getAlpha()
Returns the scale value that will control how many points are added to a cluster. Smaller values will create more, smaller clusters - and more points will be labeled as noise. Larger values causes larger and fewer clusters.- Returns:
- the scale value to use
-
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[]
-
clone
public LSDBC clone()
- Specified by:
clonein interfaceClusterer- Specified by:
clonein classClustererBase
-
-
DataMelt 3.0 © DataMelt by jWork.ORG