Package elki.clustering.meta
Class ExternalClustering
- java.lang.Object
-
- elki.clustering.meta.ExternalClustering
-
- All Implemented Interfaces:
elki.Algorithm,ClusteringAlgorithm<Clustering<? extends Model>>
@Description("Load clustering results from an external file. Each line is expected to consists of one clustering, one integer per point and an (optional) non-numeric label.") public class ExternalClustering extends java.lang.Object implements ClusteringAlgorithm<Clustering<? extends Model>>Read an external clustering result from a file, such as produced byClusteringVectorDumper.The input format of this parser is text-based:
# Optional comment 1 1 1 2 2 2 -1 Example label
Where non-negative numbers are cluster assignments, negative numbers are considered noise clusters.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExternalClustering.ParParameterization class
-
Constructor Summary
Constructors Constructor Description ExternalClustering(java.net.URI file)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidattachToRelation(elki.database.relation.Relation<?> r, it.unimi.dsi.fastutil.ints.IntArrayList assignment, java.util.ArrayList<java.lang.String> name)Build a clustering from the file result.Clustering<? extends Model>autorun(elki.database.Database database)Run the algorithm.elki.data.type.TypeInformation[]getInputTypeRestriction()
-
-
-
Field Detail
-
LOG
private static final elki.logging.Logging LOG
The logger for this class.
-
COMMENT
public static final java.lang.String COMMENT
The comment character.- See Also:
- Constant Field Values
-
file
private java.net.URI file
The file to be reparsed.
-
-
Method Detail
-
getInputTypeRestriction
public elki.data.type.TypeInformation[] getInputTypeRestriction()
- Specified by:
getInputTypeRestrictionin interfaceelki.Algorithm
-
autorun
public Clustering<? extends Model> autorun(elki.database.Database database)
Run the algorithm.- Specified by:
autorunin interfaceelki.Algorithm- Specified by:
autorunin interfaceClusteringAlgorithm<Clustering<? extends Model>>- Parameters:
database- Database to use- Returns:
- Result
-
attachToRelation
private void attachToRelation(elki.database.relation.Relation<?> r, it.unimi.dsi.fastutil.ints.IntArrayList assignment, java.util.ArrayList<java.lang.String> name)Build a clustering from the file result.- Parameters:
r- Result to attach toassignment- Cluster assignmentname- Name
-
-