Package tutorial.clustering
Class NaiveAgglomerativeHierarchicalClustering2<O>
- java.lang.Object
-
- tutorial.clustering.NaiveAgglomerativeHierarchicalClustering2<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
Algorithm
public class NaiveAgglomerativeHierarchicalClustering2<O> extends java.lang.Object implements Algorithm
This tutorial will step you through implementing a well known clustering algorithm, agglomerative hierarchical clustering, in multiple steps.This is the second step, where we increase the performance of the algorithm by using an improved linear memory layout instead of ragged arrays.
This is the naive O(n³) algorithm. See
SLINK
for a much faster algorithm (however, only for single-linkage).- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Constructor Summary
Constructors Constructor Description NaiveAgglomerativeHierarchicalClustering2(Distance<? super O> distance, int numclusters)
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.Clustering<Model>
run(Relation<O> relation)
Perform HACprotected static int
triangleSize(int x)
Compute the size of a complete x by x triangle (minus diagonal)
-
-
-
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<Model> run(Relation<O> relation)
Perform HAC- Parameters:
relation
- Data relation- Returns:
- Clustering
-
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
-
-