summaryrefslogtreecommitdiff
path: root/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
diff options
context:
space:
mode:
Diffstat (limited to 'elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java')
-rw-r--r--elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java41
1 files changed, 25 insertions, 16 deletions
diff --git a/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java b/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
index 29006f01..d2ba1b38 100644
--- a/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
+++ b/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/trivial/ByLabelClustering.java
@@ -47,6 +47,7 @@ import de.lmu.ifi.dbs.elki.database.ids.HashSetModifiableDBIDs;
import de.lmu.ifi.dbs.elki.database.ids.ModifiableDBIDs;
import de.lmu.ifi.dbs.elki.database.relation.Relation;
import de.lmu.ifi.dbs.elki.logging.Logging;
+import de.lmu.ifi.dbs.elki.utilities.Alias;
import de.lmu.ifi.dbs.elki.utilities.documentation.Description;
import de.lmu.ifi.dbs.elki.utilities.documentation.Title;
import de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizer;
@@ -65,16 +66,18 @@ import de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.PatternParameter;
*
* If an assignment of an object to multiple clusters is desired, the labels of
* the object indicating the clusters need to be separated by blanks and the
- * flag {@link #MULTIPLE_ID} needs to be set.
+ * flag {@link Parameterizer#MULTIPLE_ID} needs to be set.
*
* TODO: handling of data sets with no labels?
*
* @author Erich Schubert
+ * @since 0.2
*
* @apiviz.uses de.lmu.ifi.dbs.elki.data.ClassLabel
*/
@Title("Clustering by label")
@Description("Cluster points by a (pre-assigned!) label. For comparing results with a reference clustering.")
+@Alias("de.lmu.ifi.dbs.elki.algorithm.clustering.ByLabelClustering")
public class ByLabelClustering extends AbstractAlgorithm<Clustering<Model>> implements ClusteringAlgorithm<Clustering<Model>> {
/**
* The logger for this class.
@@ -82,24 +85,12 @@ public class ByLabelClustering extends AbstractAlgorithm<Clustering<Model>> impl
private static final Logging LOG = Logging.getLogger(ByLabelClustering.class);
/**
- * Flag to indicate that multiple cluster assignment is possible. If an
- * assignment to multiple clusters is desired, the labels indicating the
- * clusters need to be separated by blanks.
- */
- public static final OptionID MULTIPLE_ID = new OptionID("bylabelclustering.multiple", "Flag to indicate that only subspaces with large coverage " + "(i.e. the fraction of the database that is covered by the dense units) " + "are selected, the rest will be pruned.");
-
- /**
- * Pattern to recognize noise clusters by.
- */
- public static final OptionID NOISE_ID = new OptionID("bylabelclustering.noise", "Pattern to recognize noise classes by their label.");
-
- /**
- * Holds the value of {@link #MULTIPLE_ID}.
+ * Allow multiple cluster assignment.
*/
private boolean multiple;
/**
- * Holds the value of {@link #NOISE_ID}.
+ * Pattern to recognize noise clusters by.
*/
private Pattern noisepattern = null;
@@ -248,8 +239,26 @@ public class ByLabelClustering extends AbstractAlgorithm<Clustering<Model>> impl
* @apiviz.exclude
*/
public static class Parameterizer extends AbstractParameterizer {
+ /**
+ * Flag to indicate that multiple cluster assignment is possible. If an
+ * assignment to multiple clusters is desired, the labels indicating the
+ * clusters need to be separated by blanks.
+ */
+ public static final OptionID MULTIPLE_ID = new OptionID("bylabelclustering.multiple", "Flag to indicate that only subspaces with large coverage " + "(i.e. the fraction of the database that is covered by the dense units) " + "are selected, the rest will be pruned.");
+
+ /**
+ * Parameter to specify the pattern to recognize noise clusters by.
+ */
+ public static final OptionID NOISE_ID = new OptionID("bylabelclustering.noise", "Pattern to recognize noise classes by their label.");
+
+ /**
+ * Allow multiple cluster assignment.
+ */
protected boolean multiple;
+ /**
+ * Pattern to recognize noise clusters by.
+ */
protected Pattern noisepat;
@Override
@@ -272,4 +281,4 @@ public class ByLabelClustering extends AbstractAlgorithm<Clustering<Model>> impl
return new ByLabelClustering(multiple, noisepat);
}
}
-} \ No newline at end of file
+}