|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.logging.AbstractLoggable de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult<O> de.lmu.ifi.dbs.elki.algorithm.result.clustering.ClustersPlusNoise<O>
O
- the type of DatabaseObjects handled by this Resultpublic class ClustersPlusNoise<O extends DatabaseObject>
Provides a result of a clustering-algorithm that computes several clusters and remaining noise.
Field Summary | |
---|---|
static String |
CLUSTER_LABEL_PREFIX
todo comment |
static String |
CLUSTER_MARKER
Marker for a file name of a cluster. |
(package private) Integer[][] |
clustersAndNoise
An array of clusters and noise, respectively, where each array provides the object ids of its members. |
protected Map<Integer,Result<O>> |
clusterToModel
todo comment |
static String |
NOISE_MARKER
Marker for a file name of noise. |
Fields inherited from class de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult |
---|
db, FILE_EXTENSION |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Fields inherited from interface de.lmu.ifi.dbs.elki.algorithm.result.Result |
---|
SEPARATOR |
Constructor Summary | |
---|---|
ClustersPlusNoise(Integer[][] clustersAndNoise,
Database<O> db)
Provides a result of a clustering-algorithm that computes several clusters and remaining noise. |
Method Summary | ||
---|---|---|
|
appendModel(L clusterID,
Result<O> model)
Appends a model the designated cluster. |
|
|
associate(Class<L> classLabel)
Returns a new Database containing only non-noise Objects with a clusterID associated as AssociationID#CLASS . |
|
protected String |
canonicalClusterLabel(int clusterID)
todo coment |
|
protected
|
classLabelToClusterID(L classLabel)
todo coment |
|
|
clustering(Class<L> classLabel)
Returns a Map of ClassLabel to Database, comprising a separate database for each cluster. |
|
Integer[][] |
getClusterAndNoiseArray()
Returns the array of clusters and noise, respectively, where each array provides the object ids of its members. |
|
Cluster<O>[] |
getClusters()
Returns the clusters as array of arrays of object ids. |
|
Database<O> |
noise()
Returns a database containing only noise objects. |
|
void |
output(File out,
Normalization<O> normalization,
List<AttributeSettings> settings)
Writes the clustering result to the given file. |
|
void |
output(PrintStream outStream,
Normalization<O> normalization,
List<AttributeSettings> settings)
Writes the clustering result to the given stream. |
|
private void |
write(int clusterIndex,
PrintStream out,
Normalization<O> normalization,
List<AttributeSettings> settings)
Writes a cluster denoted by its cluster number to the designated print stream. |
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.result.AbstractResult |
---|
getDatabase, writeHeader |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CLUSTER_MARKER
public static final String NOISE_MARKER
public static final String CLUSTER_LABEL_PREFIX
protected Map<Integer,Result<O extends DatabaseObject>> clusterToModel
Integer[][] clustersAndNoise
Constructor Detail |
---|
public ClustersPlusNoise(Integer[][] clustersAndNoise, Database<O> db)
clustersAndNoise
- an array of clusters and noise, respectively,
where each array provides the object ids of its members, the last
element in the array contains the noise idsdb
- the database containing the objects of clustersMethod Detail |
---|
public Cluster<O>[] getClusters()
ClusteringResult
getClusters
in interface ClusteringResult<O extends DatabaseObject>
ClusteringResult.getClusters()
public void output(File out, Normalization<O> normalization, List<AttributeSettings> settings) throws UnableToComplyException
Result
output
in interface Result<O extends DatabaseObject>
output
in class AbstractResult<O extends DatabaseObject>
out
- file, which designates the location to write the results,
or which's name designates the prefix of any locations to write the results,
or which could remain null to designate the standard-out as location for output.normalization
- Normalization to restore original values according to, if this action is supported
- may remain null.settings
- the settings to be written into the header, if this parameter is null
,
no header will be written
UnableToComplyException
- if any feature vector is not compatible with values initialized during normalizationResult.output(File,Normalization,List)
public void output(PrintStream outStream, Normalization<O> normalization, List<AttributeSettings> settings) throws UnableToComplyException
Result
output
in interface Result<O extends DatabaseObject>
outStream
- the stream to write tonormalization
- Normalization to restore original values according to, if this action is supported
- may remain null.settings
- the settings to be written into the header, if this parameter is null
,
no header will be written
UnableToComplyException
- if any feature vector is not compatible with values initialized during normalizationResult.output(java.io.PrintStream,
de.lmu.ifi.dbs.elki.normalization.Normalization,java.util.List)
private void write(int clusterIndex, PrintStream out, Normalization<O> normalization, List<AttributeSettings> settings) throws NonNumericFeaturesException
clusterIndex
- the number of the cluster to be writtenout
- the print stream where to writenormalization
- a Normalization to restore original values for
output - may remain nullsettings
- the settings to be written into the header
NonNumericFeaturesException
- if feature vector is not compatible
with values initialized during normalizationpublic Integer[][] getClusterAndNoiseArray()
public <L extends ClassLabel<L>> Database<O> associate(Class<L> classLabel)
ClusteringResult
AssociationID#CLASS
.
associate
in interface ClusteringResult<O extends DatabaseObject>
classLabel
- the class to be used as ClassLabel
ClusteringResult.associate(Class)
public <L extends ClassLabel<L>> Map<L,Database<O>> clustering(Class<L> classLabel)
ClusteringResult
clustering
in interface ClusteringResult<O extends DatabaseObject>
classLabel
- the class to be used as ClassLabel
ClusteringResult.clustering(Class)
public Database<O> noise()
ClusteringResult
noise
in interface ClusteringResult<O extends DatabaseObject>
ClusteringResult.noise()
public <L extends ClassLabel<L>> void appendModel(L clusterID, Result<O> model)
ClusteringResult
appendModel
in interface ClusteringResult<O extends DatabaseObject>
clusterID
- ClassLabel assigned to the cluster a model should be appended tomodel
- the model describing the designated clusterClusteringResult.appendModel(ClassLabel,
de.lmu.ifi.dbs.elki.algorithm.result.Result)
protected <L extends ClassLabel<L>> Integer classLabelToClusterID(L classLabel)
protected String canonicalClusterLabel(int clusterID)
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |