Package elki.clustering.kmedoids
Class FasterCLARA<O>
- java.lang.Object
-
- elki.clustering.kmedoids.PAM<O>
-
- elki.clustering.kmedoids.FastPAM1<O>
-
- elki.clustering.kmedoids.FastPAM<O>
-
- elki.clustering.kmedoids.FasterPAM<O>
-
- elki.clustering.kmedoids.FasterCLARA<O>
-
- Type Parameters:
O
- Data type
- All Implemented Interfaces:
Algorithm
,ClusteringAlgorithm<Clustering<MedoidModel>>
,KMedoidsClustering<O>
@Reference(authors="Erich Schubert and Peter J. Rousseeuw", title="Fast and Eager k-Medoids Clustering: O(k) Runtime Improvement of the PAM, CLARA, and CLARANS Algorithms", booktitle="arXiv preprint", url="https://arxiv.org/abs/2008.05171", bibkey="DBLP:journals/corr/abs-2008-05171") public class FasterCLARA<O> extends FasterPAM<O>
Clustering Large Applications (CLARA) with theFastPAM
improvements, to increase scalability in the number of clusters. This variant will also default to twice the sample size, to improve quality.TODO: use a triangular distance matrix, rather than a hash-map based cache, for a bit better performance and less memory.
Reference:
Erich Schubert and Peter J. Rousseeuw
Fast and Eager k-Medoids Clustering: O(k) Runtime Improvement of the PAM, CLARA, and CLARANS Algorithms
Preprint- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FasterCLARA.Par<V>
Parameterization class.-
Nested classes/interfaces inherited from class elki.clustering.kmedoids.FasterPAM
FasterPAM.Instance
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
keepmed
Keep the previous medoids in the sample (see page 145).private static Logging
LOG
Class logger.(package private) int
numsamples
Number of samples to draw (i.e. iterations).(package private) RandomFactory
random
Random factory for initialization.(package private) double
sampling
Sampling rate.-
Fields inherited from class elki.clustering.kmedoids.PAM
distance, initializer, k, maxiter
-
-
Constructor Summary
Constructors Constructor Description FasterCLARA(Distance<? super O> distance, int k, int maxiter, KMedoidsInitialization<O> initializer, int numsamples, double sampling, boolean keepmed, RandomFactory random)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Clustering<MedoidModel>
run(Relation<O> relation)
Run k-medoids clustering.Clustering<MedoidModel>
run(Relation<O> relation, int k, DistanceQuery<? super O> distQ)
Run k-medoids clustering with a given distance query.
Not a very elegant API, but needed for some types of nested k-medoids.-
Methods inherited from class elki.clustering.kmedoids.PAM
getInputTypeRestriction, initialMedoids, wrapResult
-
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.
-
sampling
double sampling
Sampling rate. If less than 1, it is considered to be a relative value.
-
numsamples
int numsamples
Number of samples to draw (i.e. iterations).
-
keepmed
boolean keepmed
Keep the previous medoids in the sample (see page 145).
-
random
RandomFactory random
Random factory for initialization.
-
-
Constructor Detail
-
FasterCLARA
public FasterCLARA(Distance<? super O> distance, int k, int maxiter, KMedoidsInitialization<O> initializer, int numsamples, double sampling, boolean keepmed, RandomFactory random)
Constructor.- Parameters:
distance
- Distance function to usek
- Number of clusters to producemaxiter
- Maximum number of iterationsinitializer
- Initialization functionnumsamples
- Number of samples (sampling iterations)sampling
- Sampling rate (absolute or relative)keepmed
- Keep the previous medoids in the next samplerandom
- Random generator
-
-
Method Detail
-
run
public Clustering<MedoidModel> run(Relation<O> relation)
Description copied from interface:KMedoidsClustering
Run k-medoids clustering.
-
run
public Clustering<MedoidModel> run(Relation<O> relation, int k, DistanceQuery<? super O> distQ)
Description copied from interface:KMedoidsClustering
Run k-medoids clustering with a given distance query.
Not a very elegant API, but needed for some types of nested k-medoids.
-
-