
O - Object type@Reference(authors="M. R. Anderberg", title="Hierarchical Clustering Methods", booktitle="Cluster Analysis for Applications") public class AnderbergHierarchicalClustering<O> extends AbstractDistanceBasedAlgorithm<O,PointerHierarchyRepresentationResult> implements HierarchicalClusteringAlgorithm
M. R. Anderberg
Hierarchical Clustering Methods
Cluster Analysis for Applications
ISBN: 0120576503
| Modifier and Type | Class and Description |
|---|---|
static class |
AnderbergHierarchicalClustering.Parameterizer<O>
Parameterization class
|
| Modifier and Type | Field and Description |
|---|---|
(package private) LinkageMethod |
linkage
Current linkage method in use.
|
private static Logging |
LOG
Class logger
|
DISTANCE_FUNCTION_ID| Constructor and Description |
|---|
AnderbergHierarchicalClustering(DistanceFunction<? super O> distanceFunction,
LinkageMethod linkage)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
findBest(int size,
double[] scratch,
double[] bestd,
int[] besti,
int j) |
protected int |
findMerge(int size,
double[] scratch,
DBIDArrayIter ix,
DBIDArrayIter iy,
double[] bestd,
int[] besti,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda,
WritableIntegerDataStore csize)
Perform the next merge step.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
private static void |
initializeNNCache(double[] scratch,
double[] bestd,
int[] besti)
Initialize the NN cache.
|
protected void |
merge(int size,
double[] scratch,
DBIDArrayIter ix,
DBIDArrayIter iy,
double[] bestd,
int[] besti,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda,
WritableIntegerDataStore csize,
double mindist,
int x,
int y)
Execute the cluster merge.
|
PointerHierarchyRepresentationResult |
run(Database db,
Relation<O> relation)
Run the algorithm
|
private void |
updateCache(int size,
double[] scratch,
double[] bestd,
int[] besti,
int x,
int y,
int j,
double d)
Update the cache.
|
protected void |
updateMatrix(int size,
double[] scratch,
DBIDArrayIter ij,
double[] bestd,
int[] besti,
WritableDoubleDataStore lambda,
WritableIntegerDataStore csize,
double mindist,
int x,
int y,
int sizex,
int sizey)
Update the scratch distance matrix.
|
getDistanceFunctionmakeParameterDistanceFunction, runclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrunprivate static final Logging LOG
LinkageMethod linkage
public AnderbergHierarchicalClustering(DistanceFunction<? super O> distanceFunction, LinkageMethod linkage)
distanceFunction - Distance function to uselinkage - Linkage methodpublic PointerHierarchyRepresentationResult run(Database db, Relation<O> relation)
db - Databaserelation - Relationprivate static void initializeNNCache(double[] scratch,
double[] bestd,
int[] besti)
scratch - Scatch spacebestd - Best distancebesti - Best indexprotected int findMerge(int size,
double[] scratch,
DBIDArrayIter ix,
DBIDArrayIter iy,
double[] bestd,
int[] besti,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda,
WritableIntegerDataStore csize)
size - Data set sizescratch - Scratch space.ix - First iteratoriy - Second iteratorbestd - Best distancebesti - Index of best distancepi - Parent storagelambda - Lambda (join distance) storagecsize - Cluster sizesprotected void merge(int size,
double[] scratch,
DBIDArrayIter ix,
DBIDArrayIter iy,
double[] bestd,
int[] besti,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda,
WritableIntegerDataStore csize,
double mindist,
int x,
int y)
size - Data set sizescratch - Scratch space.ix - First iteratoriy - Second iteratorbestd - Best distancebesti - Index of best distancepi - Parent storagelambda - Lambda (join distance) storagecsize - Cluster sizesmindist - Distance that was used for mergingx - First matrix positiony - Second matrix positionprotected void updateMatrix(int size,
double[] scratch,
DBIDArrayIter ij,
double[] bestd,
int[] besti,
WritableDoubleDataStore lambda,
WritableIntegerDataStore csize,
double mindist,
int x,
int y,
int sizex,
int sizey)
size - Data set sizescratch - Scratch matrix.ij - Iterator to reusebestd - Best distancebesti - Index of best distancelambda - Lambda (join distance) storagecsize - Cluster sizesmindist - Distance that was used for mergingx - First matrix positiony - Second matrix positionsizex - Old size of first clustersizey - Old size of second clusterprivate void updateCache(int size,
double[] scratch,
double[] bestd,
int[] besti,
int x,
int y,
int j,
double d)
size - Working set sizescratch - Scratch matrixbestd - Best distancebesti - Best indexx - First clustery - Second cluster, y < xj - Updated value d(y, j)d - New distanceprotected void findBest(int size,
double[] scratch,
double[] bestd,
int[] besti,
int j)
public TypeInformation[] getInputTypeRestriction()
AbstractAlgorithmgetInputTypeRestriction in interface AlgorithmgetInputTypeRestriction in class AbstractAlgorithm<PointerHierarchyRepresentationResult>protected Logging getLogger()
AbstractAlgorithmgetLogger in class AbstractAlgorithm<PointerHierarchyRepresentationResult>Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.