public class ExtractFlatClusteringFromHierarchy extends Object implements ClusteringAlgorithm<Clustering<DendrogramModel>>
Modifier and Type | Class and Description |
---|---|
static class |
ExtractFlatClusteringFromHierarchy.Parameterizer
Parameterization class.
|
static class |
ExtractFlatClusteringFromHierarchy.ThresholdMode
Threshold mode.
|
Modifier and Type | Field and Description |
---|---|
private HierarchicalClusteringAlgorithm |
algorithm
Clustering algorithm to run to obtain the hierarchy.
|
private boolean |
hierarchical
Include empty clusters in the hierarchy produced.
|
private static Logging |
LOG
Class logger.
|
private int |
minclusters
Minimum number of clusters to extract
|
private boolean |
nosingletons
Merge singleton clusters into the parent cluster.
|
private double |
threshold
Threshold for extracting clusters.
|
Constructor and Description |
---|
ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm,
double threshold,
boolean hierarchical,
boolean nosingletons)
Constructor.
|
ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm,
int minclusters,
boolean hierarchical,
boolean nosingletons)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Clustering<DendrogramModel> |
extractClusters(DBIDs ids,
DBIDDataStore pi,
DoubleDataStore lambda)
Extract all clusters from the pi-lambda-representation.
|
private int |
findSplit(ArrayDBIDs order,
DBIDArrayIter it,
DoubleDataStore lambda)
Find the splitting point in the ordered DBIDs list.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
private Cluster<DendrogramModel> |
makeCluster(DBIDRef lead,
double depth,
DBIDs members)
Make the cluster for the given object
|
Clustering<DendrogramModel> |
run(Database database)
Runs the algorithm.
|
private static final Logging LOG
private final int minclusters
private final double threshold
private final boolean hierarchical
private final boolean nosingletons
private final HierarchicalClusteringAlgorithm algorithm
public ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm, int minclusters, boolean hierarchical, boolean nosingletons)
algorithm
- Algorithm to runminclusters
- Minimum number of clustershierarchical
- Produce a hierarchical outputnosingletons
- Merge singletons into parentpublic ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm, double threshold, boolean hierarchical, boolean nosingletons)
algorithm
- Algorithm to runthreshold
- Distance thresholdhierarchical
- Produce a hierarchical outputnosingletons
- Merge singletons into parentpublic Clustering<DendrogramModel> run(Database database)
Algorithm
run
in interface Algorithm
run
in interface ClusteringAlgorithm<Clustering<DendrogramModel>>
database
- the database to run the algorithm onpublic Clustering<DendrogramModel> extractClusters(DBIDs ids, DBIDDataStore pi, DoubleDataStore lambda)
ids
- Object ids to processpi
- Pi storelambda
- Lambda storeprivate int findSplit(ArrayDBIDs order, DBIDArrayIter it, DoubleDataStore lambda)
order
- Ordered listit
- Iterator on this list (reused)lambda
- Join distances.private Cluster<DendrogramModel> makeCluster(DBIDRef lead, double depth, DBIDs members)
lead
- Leading objectdepth
- Linkage depthmembers
- Member objectspublic TypeInformation[] getInputTypeRestriction()
Algorithm
getInputTypeRestriction
in interface Algorithm
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.