@Title(value="Clustering by label") @Description(value="Cluster points by a (pre-assigned!) label. For comparing results with a reference clustering.") @Alias(value="de.lmu.ifi.dbs.elki.algorithm.clustering.ByLabelClustering") @Priority(value=-100) public class ByLabelClustering extends AbstractAlgorithm<Clustering<Model>> implements ClusteringAlgorithm<Clustering<Model>>
ByLabelClustering.Parameterizer.MULTIPLE_ID
needs to be set.
TODO: handling of data sets with no labels?Modifier and Type | Class and Description |
---|---|
static class |
ByLabelClustering.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
The logger for this class.
|
private boolean |
multiple
Allow multiple cluster assignment.
|
private java.util.regex.Pattern |
noisepattern
Pattern to recognize noise clusters by.
|
ALGORITHM_ID
Constructor and Description |
---|
ByLabelClustering()
Constructor without parameters
|
ByLabelClustering(boolean multiple,
java.util.regex.Pattern noisepattern)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
assign(java.util.HashMap<java.lang.String,DBIDs> labelMap,
java.lang.String label,
DBIDRef id)
Assigns the specified id to the labelMap according to its label
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
private java.util.HashMap<java.lang.String,DBIDs> |
multipleAssignment(Relation<?> data)
Assigns the objects of the database to multiple clusters according to their
labels.
|
Clustering<Model> |
run(Database database)
Runs the algorithm.
|
Clustering<Model> |
run(Relation<?> relation)
Run the actual clustering algorithm.
|
private java.util.HashMap<java.lang.String,DBIDs> |
singleAssignment(Relation<?> data)
Assigns the objects of the database to single clusters according to their
labels.
|
private static final Logging LOG
private boolean multiple
private java.util.regex.Pattern noisepattern
public ByLabelClustering(boolean multiple, java.util.regex.Pattern noisepattern)
multiple
- Allow multiple cluster assignmentsnoisepattern
- Noise patternpublic ByLabelClustering()
public Clustering<Model> run(Database database)
Algorithm
run
in interface Algorithm
run
in interface ClusteringAlgorithm<Clustering<Model>>
run
in class AbstractAlgorithm<Clustering<Model>>
database
- the database to run the algorithm onpublic Clustering<Model> run(Relation<?> relation)
relation
- The data input we useprivate java.util.HashMap<java.lang.String,DBIDs> singleAssignment(Relation<?> data)
data
- the database storing the objectsprivate java.util.HashMap<java.lang.String,DBIDs> multipleAssignment(Relation<?> data)
data
- the database storing the objectsprivate void assign(java.util.HashMap<java.lang.String,DBIDs> labelMap, java.lang.String label, DBIDRef id)
labelMap
- the mapping of label to idslabel
- the label of the object to be assignedid
- the id of the object to be assignedpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Clustering<Model>>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Clustering<Model>>
Copyright © 2019 ELKI Development Team. License information.