|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<R>
de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm<O,D,Result>
de.lmu.ifi.dbs.elki.algorithm.clustering.SLINK<O,D>
O - the type of DatabaseObject the algorithm is applied onD - the type of Distance used@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="http://dx.doi.org/10.1093/comjnl/16.1.30")
public class SLINK<O,D extends Distance<D>>
Efficient implementation of the Single-Link Algorithm SLINK of R. Sibson.
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.
| Nested Class Summary | |
|---|---|
private static class |
SLINK.CompareByLambda<D extends Distance<D>>
Order a DBID collection by the lambda value. |
static class |
SLINK.Parameterizer<O,D extends Distance<D>>
Parameterization class. |
| Field Summary | |
|---|---|
private WritableDataStore<D> |
lambda
The values of the function Lambda of the pointer representation. |
private static Logging |
logger
The logger for this class. |
private Integer |
minclusters
Minimum number of clusters to extract |
private WritableDataStore<DBID> |
pi
The values of the function Pi of the pointer representation. |
static OptionID |
SLINK_MINCLUSTERS_ID
The minimum number of clusters to extract |
| Fields inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm |
|---|
DISTANCE_FUNCTION_ID |
| Constructor Summary | |
|---|---|
SLINK(DistanceFunction<? super O,D> distanceFunction,
Integer minclusters)
Constructor. |
|
| Method Summary | |
|---|---|
private Cluster<DendrogramModel<D>> |
createParent(String name,
Cluster<DendrogramModel<D>> leftChild,
Cluster<DendrogramModel<D>> rightChild,
D distance,
ModifiableHierarchy<Cluster<DendrogramModel<D>>> hier)
|
private Clustering<Model> |
extractClusters_erich(DBIDs ids,
DataStore<DBID> pi,
DataStore<D> lambda,
int minclusters)
Extract all clusters from the pi-lambda-representation. |
private Clustering<DendrogramModel<D>> |
extractClusters(DBIDs ids,
DataStore<DBID> pi,
DataStore<D> lambda,
int minclusters)
Extract all clusters from the pi-lambda-representation. |
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query. |
protected Logging |
getLogger()
Get the (STATIC) logger for this class. |
private Cluster<DendrogramModel<D>> |
lastAncestor(Cluster<DendrogramModel<D>> cluster,
ModifiableHierarchy<Cluster<DendrogramModel<D>>> hier)
Determines recursively the last ancestor of the specified cluster. |
private DBID |
lastObjectInCluster(DBID id,
D stopdist,
DataStore<DBID> pi,
DataStore<D> lambda)
|
private Cluster<DendrogramModel<D>> |
root(Map<DBID,ModifiableDBIDs> cluster_ids,
Map<DBID,D> cluster_distances,
DataStore<DBID> pi,
DataStore<D> lambda,
ModifiableHierarchy<Cluster<DendrogramModel<D>>> hier,
FiniteProgress progress)
|
Result |
run(Database database,
Relation<O> relation)
Performs the SLINK algorithm on the given database. |
private void |
step1(DBID newID)
First step: Initialize P(id) = id, L(id) = infinity. |
private void |
step2(DBID newID,
DBIDs processedIDs,
DistanceQuery<O,D> distFunc,
WritableDataStore<D> m)
Second step: Determine the pairwise distances from all objects in the pointer representation to the new object with the specified id. |
private void |
step3(DBID newID,
DBIDs processedIDs,
WritableDataStore<D> m)
Third step: Determine the values for P and L |
private void |
step4(DBID newID,
DBIDs processedIDs)
Fourth step: Actualize the clusters if necessary |
| Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm |
|---|
getDistanceFunction |
| Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm |
|---|
makeParameterDistanceFunction, run |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Logging logger
public static final OptionID SLINK_MINCLUSTERS_ID
private WritableDataStore<DBID> pi
private WritableDataStore<D extends Distance<D>> lambda
private Integer minclusters
| Constructor Detail |
|---|
public SLINK(DistanceFunction<? super O,D> distanceFunction,
Integer minclusters)
distanceFunction - Distance functionminclusters - Minimum clusters to extract. Can be null| Method Detail |
|---|
public Result run(Database database,
Relation<O> relation)
private void step1(DBID newID)
newID - the id of the object to be inserted into the pointer
representation
private void step2(DBID newID,
DBIDs processedIDs,
DistanceQuery<O,D> distFunc,
WritableDataStore<D> m)
newID - the id of the object to be inserted into the pointer
representationprocessedIDs - the already processed idsdistFunc - Distance function to use
private void step3(DBID newID,
DBIDs processedIDs,
WritableDataStore<D> m)
newID - the id of the object to be inserted into the pointer
representationprocessedIDs - the already processed ids
private void step4(DBID newID,
DBIDs processedIDs)
newID - the id of the current objectprocessedIDs - the already processed ids
private DBID lastObjectInCluster(DBID id,
D stopdist,
DataStore<DBID> pi,
DataStore<D> lambda)
private Clustering<DendrogramModel<D>> extractClusters(DBIDs ids,
DataStore<DBID> pi,
DataStore<D> lambda,
int minclusters)
ids - Object ids to processpi - Pi storelambda - Lambda storeminclusters - Minimum number of clusters to extract
private Cluster<DendrogramModel<D>> root(Map<DBID,ModifiableDBIDs> cluster_ids,
Map<DBID,D> cluster_distances,
DataStore<DBID> pi,
DataStore<D> lambda,
ModifiableHierarchy<Cluster<DendrogramModel<D>>> hier,
FiniteProgress progress)
private Cluster<DendrogramModel<D>> lastAncestor(Cluster<DendrogramModel<D>> cluster,
ModifiableHierarchy<Cluster<DendrogramModel<D>>> hier)
cluster - the childhier - the cluster hierarchy
private Cluster<DendrogramModel<D>> createParent(String name,
Cluster<DendrogramModel<D>> leftChild,
Cluster<DendrogramModel<D>> rightChild,
D distance,
ModifiableHierarchy<Cluster<DendrogramModel<D>>> hier)
private Clustering<Model> extractClusters_erich(DBIDs ids,
DataStore<DBID> pi,
DataStore<D> lambda,
int minclusters)
ids - Object ids to processpi - Pi storelambda - Lambda storeminclusters - Minimum number of clusters to extract
public TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction in interface AlgorithmgetInputTypeRestriction in class AbstractAlgorithm<Result>protected Logging getLogger()
AbstractAlgorithm
getLogger in class AbstractAlgorithm<Result>
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||