O
- Object typepublic class NaiveAgglomerativeHierarchicalClustering2<O> extends AbstractDistanceBasedAlgorithm<O,Result>
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).
Modifier and Type | Class and Description |
---|---|
static class |
NaiveAgglomerativeHierarchicalClustering2.Parameterizer<O>
Parameterization class
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
Class logger
|
(package private) int |
numclusters
Threshold, how many clusters to extract.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
NaiveAgglomerativeHierarchicalClustering2(DistanceFunction<? super O> distanceFunction,
int numclusters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
Result |
run(Database db,
Relation<O> relation)
Run the algorithm
|
protected static int |
triangleSize(int x)
Compute the size of a complete x by x triangle (minus diagonal)
|
getDistanceFunction
run
private static final Logging LOG
int numclusters
public NaiveAgglomerativeHierarchicalClustering2(DistanceFunction<? super O> distanceFunction, int numclusters)
distanceFunction
- Distance function to usenumclusters
- Number of clusterspublic Result run(Database db, Relation<O> relation)
db
- Databaserelation
- Relationprotected static int triangleSize(int x)
x
- Offsetpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Result>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Result>
Copyright © 2019 ELKI Development Team. License information.