public class MeanShift extends ClustererBase
MultivariateKDE
to run. Contrary to use in
density estimation, where the KernelFunction
used has only a minor
impact on the results, it is highly recommended you use the GaussKF
for the MeanShift method. This is because of the large support and better
behaved derivative, which adds in the avoidance of oscillating convergence.
Modifier and Type | Field and Description |
---|---|
static int |
DefaultMaxIterations
The default number of
getMaxIterations() is 1000 |
static double |
DefaultScaleBandwidthFactor
The default value of
getScaleBandwidthFactor() is 1.0 |
Constructor and Description |
---|
MeanShift()
Creates a new MeanShift clustering object using a
MetricKDE ,
the GaussKF , and the EuclideanDistance . |
MeanShift(DistanceMetric dm)
|
MeanShift(MeanShift toCopy)
Copy constructor
|
MeanShift(MultivariateKDE mkde)
Creates a new MeanShift clustering object.
|
Modifier and Type | Method and Description |
---|---|
MeanShift |
clone() |
int[] |
cluster(DataSet dataSet,
ExecutorService threadpool,
int[] designations)
Performs clustering on the given data set.
|
int[] |
cluster(DataSet dataSet,
int[] designations)
Performs clustering on the given data set.
|
int |
getMaxIterations()
Returns the maximum number of iterations the algorithm will go through,
terminating early if convergence has not occurred.
|
double |
getScaleBandwidthFactor()
Returns the value by which the bandwidth of the
MultivariateKDE will
be scaled by. |
void |
setMaxIterations(int maxIterations)
Sets the maximum number of iterations the algorithm will go through,
terminating early if convergence has not occurred.
|
void |
setScaleBandwidthFactor(double scaleBandwidthFactor)
Sets the value by which the bandwidth of the
MultivariateKDE will
be scaled by. |
cluster, cluster, createClusterListFromAssignmentArray, getDatapointsFromCluster, supportsWeightedData
public static final int DefaultMaxIterations
getMaxIterations()
is 1000public static final double DefaultScaleBandwidthFactor
getScaleBandwidthFactor()
is 1.0public MeanShift()
MetricKDE
,
the GaussKF
, and the EuclideanDistance
.public MeanShift(DistanceMetric dm)
dm
- the distance metric to usepublic MeanShift(MultivariateKDE mkde)
ProductKDE
does not currently support the functions needed to work with MeanShift.mkde
- the KDE to use in the clustering process.public MeanShift(MeanShift toCopy)
toCopy
- the object to copypublic void setMaxIterations(int maxIterations)
maxIterations
- the maximum number of iterationsArithmeticException
- if a value less than 1 is givenpublic int getMaxIterations()
public void setScaleBandwidthFactor(double scaleBandwidthFactor)
MultivariateKDE
will
be scaled by.scaleBandwidthFactor
- the value to scale bandwidth byArithmeticException
- if the value given is NaN
or infinity
public double getScaleBandwidthFactor()
MultivariateKDE
will
be scaled by.public int[] cluster(DataSet dataSet, int[] designations)
Clusterer
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.public int[] cluster(DataSet dataSet, ExecutorService threadpool, int[] designations)
Clusterer
dataSet
- the data set to perform clustering onthreadpool
- a source of threads to run tasksdesignations
- 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.public MeanShift clone()
clone
in interface Clusterer
clone
in class ClustererBase
Copyright © 2017. All rights reserved.