Package elki.clustering
Class NaiveMeanShiftClustering<V extends NumberVector>
- java.lang.Object
-
- elki.clustering.NaiveMeanShiftClustering<V>
-
- Type Parameters:
V
- Vector type
- All Implemented Interfaces:
Algorithm
,ClusteringAlgorithm<Clustering<MeanModel>>
@Reference(authors="Y. Cheng", title="Mean shift, mode seeking, and clustering", booktitle="IEEE Transactions on Pattern Analysis and Machine Intelligence 17-8", url="https://doi.org/10.1109/34.400568", bibkey="DBLP:journals/pami/Cheng95") public class NaiveMeanShiftClustering<V extends NumberVector> extends java.lang.Object implements ClusteringAlgorithm<Clustering<MeanModel>>
Mean-shift based clustering algorithm. Naive implementation: there does not seem to be "the" mean-shift clustering algorithm, but it is a general concept. For the naive implementation, mean-shift is applied to all objects until they converge to other. This implementation is quite naive, and various optimizations can be made.It also is not really parameter-free: the kernel needs to be specified, including a radius/bandwidth.
By using range queries, the algorithm does benefit from index structures!
TODO: add methods to automatically choose the bandwidth?
Reference:
Y. Cheng
Mean shift, mode seeking, and clustering
IEEE Transactions on Pattern Analysis and Machine Intelligence 17-8- Since:
- 0.5.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description protected double
bandwidth
Range of the kernel.protected NumberVectorDistance<? super V>
distance
Distance function used.protected KernelDensityFunction
kernel
Density estimation kernel.private static Logging
LOG
Class logger.protected static int
MAXITER
Maximum number of iterations.
-
Constructor Summary
Constructors Constructor Description NaiveMeanShiftClustering(NumberVectorDistance<? super V> distance, KernelDensityFunction kernel, double range)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation[]
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.Clustering<MeanModel>
run(Relation<V> relation)
Run the mean-shift clustering algorithm.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.clustering.ClusteringAlgorithm
autorun
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
distance
protected NumberVectorDistance<? super V extends NumberVector> distance
Distance function used.
-
kernel
protected KernelDensityFunction kernel
Density estimation kernel.
-
bandwidth
protected double bandwidth
Range of the kernel.
-
MAXITER
protected static final int MAXITER
Maximum number of iterations.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NaiveMeanShiftClustering
public NaiveMeanShiftClustering(NumberVectorDistance<? super V> distance, KernelDensityFunction kernel, double range)
Constructor.- Parameters:
distance
- Distance functionkernel
- Kernel functionrange
- Kernel radius
-
-
Method Detail
-
getInputTypeRestriction
public TypeInformation[] getInputTypeRestriction()
Description copied from interface:Algorithm
Get the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestriction
in interfaceAlgorithm
- Returns:
- Type restriction
-
run
public Clustering<MeanModel> run(Relation<V> relation)
Run the mean-shift clustering algorithm.- Parameters:
relation
- Data relation- Returns:
- Clustering result
-
-