public class ExtractFlatClusteringFromHierarchy extends Object implements ClusteringAlgorithm<Clustering<DendrogramModel>>
Modifier and Type | Class and Description |
---|---|
static class |
ExtractFlatClusteringFromHierarchy.OutputMode
Output mode.
|
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 static Logging |
LOG
Class logger.
|
private int |
minclusters
Minimum number of clusters to extract
|
private ExtractFlatClusteringFromHierarchy.OutputMode |
outputmode
Include empty cluster in the hierarchy produced.
|
private boolean |
singletons
Disallow singleton clusters, but add them to the parent cluster instead.
|
private double |
threshold
Threshold for extracting clusters.
|
Constructor and Description |
---|
ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm,
double threshold,
ExtractFlatClusteringFromHierarchy.OutputMode outputmode,
boolean singletons)
Constructor.
|
ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm,
int minclusters,
ExtractFlatClusteringFromHierarchy.OutputMode outputmode,
boolean singletons)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private 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 HierarchicalClusteringAlgorithm algorithm
private ExtractFlatClusteringFromHierarchy.OutputMode outputmode
private double threshold
private boolean singletons
public ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm, int minclusters, ExtractFlatClusteringFromHierarchy.OutputMode outputmode, boolean singletons)
algorithm
- Algorithm to runminclusters
- Minimum number of clustersoutputmode
- Output mode: truncated hierarchy or strict partitions.singletons
- Allow producing singleton clusters.public ExtractFlatClusteringFromHierarchy(HierarchicalClusteringAlgorithm algorithm, double threshold, ExtractFlatClusteringFromHierarchy.OutputMode outputmode, boolean singletons)
algorithm
- Algorithm to runthreshold
- Distance thresholdoutputmode
- Output mode: truncated hierarchy or strict partitions.singletons
- Allow producing singleton clusters.public Clustering<DendrogramModel> run(Database database)
Algorithm
run
in interface Algorithm
run
in interface ClusteringAlgorithm<Clustering<DendrogramModel>>
database
- the database to run the algorithm onprivate 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.