Package elki.clustering.meta
Class ExternalClustering
- java.lang.Object
-
- elki.clustering.meta.ExternalClustering
-
- All Implemented Interfaces:
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 class
ExternalClustering.Par
Parameterization class-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
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 void
attachToRelation(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(Database database)
Run the algorithm.TypeInformation[]
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
-
-
-
Field Detail
-
LOG
private static final 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 TypeInformation[] getInputTypeRestriction()
Description copied from interface:Algorithm
Get the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestriction
in interfaceAlgorithm
- Returns:
- Type restriction
-
autorun
public Clustering<? extends Model> autorun(Database database)
Run the algorithm.- Specified by:
autorun
in interfaceAlgorithm
- Specified by:
autorun
in interfaceClusteringAlgorithm<Clustering<? extends Model>>
- Parameters:
database
- Database to use- Returns:
- Result
-
attachToRelation
private void attachToRelation(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
-
-