O
- the type of DatabaseObject the algorithm is applied on@Title(value="SLINK: Single Link Clustering") @Description(value="Hierarchical clustering algorithm based on single-link connectivity.") @Reference(authors="R. Sibson", title="SLINK: An optimally efficient algorithm for the single-link cluster method", booktitle="The Computer Journal 16 (1973), No. 1, p. 30-34.", url="https://doi.org/10.1093/comjnl/16.1.30", bibkey="DBLP:journals/cj/Sibson73") @Alias(value={"de.lmu.ifi.dbs.elki.algorithm.clustering.SLINK","clustering.SLINK","single-link","single-linkage"}) @Priority(value=200) public class SLINK<O> extends AbstractDistanceBasedAlgorithm<O,PointerHierarchyRepresentationResult> implements HierarchicalClusteringAlgorithm
This is probably the fastest exact single-link algorithm currently in use.
Reference:
R. Sibson:
SLINK: An optimally efficient algorithm for the single-link cluster
method
In: The Computer Journal 16 (1973), No. 1, p. 30-34.
Modifier and Type | Class and Description |
---|---|
static class |
SLINK.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
The logger for this class.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
SLINK(DistanceFunction<? super O> distanceFunction)
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.
|
protected void |
process(DBIDRef id,
ArrayDBIDs ids,
DBIDArrayIter it,
int n,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda,
WritableDoubleDataStore m)
SLINK main loop.
|
PointerHierarchyRepresentationResult |
run(Database database,
Relation<O> relation)
Performs the SLINK algorithm on the given database.
|
private void |
slinkstep3(DBIDRef id,
DBIDArrayIter it,
int n,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda,
WritableDoubleDataStore m)
Third step: Determine the values for P and L
|
private void |
slinkstep4(DBIDRef id,
DBIDArrayIter it,
int n,
WritableDBIDDataStore pi,
WritableDoubleDataStore lambda)
Fourth step: Actualize the clusters if necessary
|
private void |
step2(DBIDRef id,
DBIDArrayIter it,
int n,
DistanceQuery<? super O> distQuery,
WritableDoubleDataStore m)
Second step: Determine the pairwise distances from all objects in the
pointer representation to the new object with the specified id.
|
private void |
step2primitive(DBIDRef id,
DBIDArrayIter it,
int n,
Relation<? extends O> relation,
PrimitiveDistanceFunction<? super O> distFunc,
WritableDoubleDataStore m)
Second step: Determine the pairwise distances from all objects in the
pointer representation to the new object with the specified id.
|
getDistanceFunction
run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
public SLINK(DistanceFunction<? super O> distanceFunction)
distanceFunction
- Distance functionpublic PointerHierarchyRepresentationResult run(Database database, Relation<O> relation)
database
- Database to processrelation
- Data relation to useprivate void step2(DBIDRef id, DBIDArrayIter it, int n, DistanceQuery<? super O> distQuery, WritableDoubleDataStore m)
id
- the id of the object to be inserted into the pointer
representationit
- Array iteratorn
- Last objectdistQuery
- Distance querym
- Data storeprivate void step2primitive(DBIDRef id, DBIDArrayIter it, int n, Relation<? extends O> relation, PrimitiveDistanceFunction<? super O> distFunc, WritableDoubleDataStore m)
id
- the id of the object to be inserted into the pointer
representationit
- Array iteratorn
- Last objectm
- Data storerelation
- Data relationdistFunc
- Distance function to useprotected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m)
id
- Current objectids
- All objectsit
- Array iteratorn
- Last object to process at this runpi
- Parentlambda
- Heightm
- Distanceprivate void slinkstep3(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m)
id
- the id of the object to be inserted into the pointer
representationit
- array iteratorn
- Last object to process at this runpi
- Pi data storelambda
- Lambda data storem
- Data storeprivate void slinkstep4(DBIDRef id, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda)
id
- the id of the current objectit
- array iteratorn
- Last object to process at this runpi
- Pi data storelambda
- Lambda data storepublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<PointerHierarchyRepresentationResult>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<PointerHierarchyRepresentationResult>
Copyright © 2019 ELKI Development Team. License information.