Package tutorial.clustering
Class NaiveAgglomerativeHierarchicalClustering4<O>
- java.lang.Object
-
- tutorial.clustering.NaiveAgglomerativeHierarchicalClustering4<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
Algorithm
,HierarchicalClusteringAlgorithm
@Reference(authors="R. M. Cormack", title="A Review of Classification", booktitle="Journal of the Royal Statistical Society. Series A, Vol. 134, No. 3", url="https://doi.org/10.2307/2344237", bibkey="doi:10.2307/2344237") public class NaiveAgglomerativeHierarchicalClustering4<O> extends java.lang.Object implements HierarchicalClusteringAlgorithm
This tutorial will step you through implementing a well known clustering algorithm, agglomerative hierarchical clustering, in multiple steps.This is the third step, where we add support for different linkage strategies.
This is the naive O(n³) algorithm. See
SLINK
for a much faster algorithm (however, only for single-linkage).Reference (for the update formulas):
R. M. Cormack
A Review of Classification
Journal of the Royal Statistical Society. Series A, Vol. 134, No. 3- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NaiveAgglomerativeHierarchicalClustering4.Linkage
Different linkage strategies.-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Constructor Summary
Constructors Constructor Description NaiveAgglomerativeHierarchicalClustering4(Distance<? super O> distance, NaiveAgglomerativeHierarchicalClustering4.Linkage linkage)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation[]
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.ClusterMergeHistory
run(Relation<O> relation)
Run the algorithmprotected static int
triangleSize(int x)
Compute the size of a complete x by x triangle (minus diagonal)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.clustering.hierarchical.HierarchicalClusteringAlgorithm
autorun
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger
-
linkage
NaiveAgglomerativeHierarchicalClustering4.Linkage linkage
Current linkage in use.
-
-
Constructor Detail
-
NaiveAgglomerativeHierarchicalClustering4
public NaiveAgglomerativeHierarchicalClustering4(Distance<? super O> distance, NaiveAgglomerativeHierarchicalClustering4.Linkage linkage)
Constructor.- Parameters:
distance
- Distance function to uselinkage
- Linkage strategy
-
-
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 ClusterMergeHistory run(Relation<O> relation)
Run the algorithm- Parameters:
relation
- Relation- Returns:
- Clustering hierarchy
-
triangleSize
protected static int triangleSize(int x)
Compute the size of a complete x by x triangle (minus diagonal)- Parameters:
x
- Offset- Returns:
- Size of complete triangle
-
-