|
|
|||||||||||||||||||||
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.HierarchicalClusters<C,O>
O
- the type of DatabaseObjects handled by this ResultC
- the type of HierarchicalCluster used by this Resultpublic class HierarchicalClusters<C extends HierarchicalCluster<C>,O extends DatabaseObject>
Provides a result of a clustering algorithm that computes hierarchical clusters.
Field Summary | |
---|---|
static String |
CHILDREN
Indicating the children of a cluster in the string representation. |
static String |
LEVEL
Indicating the level of a cluster in the string representation. |
static String |
LEVEL_INDEX
Indicating the index within the level of a cluster in the string representation. |
static String |
PARENTS
Indicating the parents of a cluster in the string representation. |
private List<C> |
rootClusters
The root clusters. |
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 | |
---|---|
HierarchicalClusters(C rootCluster,
Database<O> db)
Provides a result of a clustering algorithm that computes hierarchical clusters from a cluster order. |
|
HierarchicalClusters(List<C> rootClusters,
Database<O> db)
Provides a result of a clustering algorithm that computes hierarchical clusters from a cluster order. |
Method Summary | |
---|---|
List<C> |
getRootClusters()
Returns the root clusters. |
void |
output(File dir,
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 cluster order to the given stream. |
private void |
write(C cluster,
File dir,
PrintStream out,
Normalization<O> normalization,
List<AttributeSettings> settings,
List<String> headerInformation,
Map<C,Boolean> written)
Writes a cluster to the designated print stream. |
protected void |
writeHeader(PrintStream out,
List<AttributeSettings> settings,
List<String> headerInformation,
C cluster)
Writes a header for the specified cluster providing information concerning the underlying database and the specified parameter-settings. |
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 String CHILDREN
public static String PARENTS
public static String LEVEL
public static String LEVEL_INDEX
private List<C extends HierarchicalCluster<C>> rootClusters
Constructor Detail |
---|
public HierarchicalClusters(List<C> rootClusters, Database<O> db)
rootClusters
- the root clustersdb
- the database containing the objects of the clusterspublic HierarchicalClusters(C rootCluster, Database<O> db)
rootCluster
- the root clusterdb
- the database containing the objects of the clustersMethod Detail |
---|
public void output(PrintStream outStream, Normalization<O> normalization, List<AttributeSettings> settings) throws UnableToComplyException
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 normalizationpublic void output(File dir, Normalization<O> normalization, List<AttributeSettings> settings) throws UnableToComplyException
Result
output
in interface Result<O extends DatabaseObject>
output
in class AbstractResult<O extends DatabaseObject>
dir
- 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(java.io.File,de.lmu.ifi.dbs.elki.normalization.Normalization,java.util.List)
private void write(C cluster, File dir, PrintStream out, Normalization<O> normalization, List<AttributeSettings> settings, List<String> headerInformation, Map<C,Boolean> written) throws NonNumericFeaturesException, FileNotFoundException
cluster
- the cluster to be writtendir
- the directory where to writenormalization
- a Normalization to restore original values for output - may
remain nullsettings
- the settings to be written into the headerheaderInformation
- list of header informations (each entry written in a separate linewritten
- the already written clusters
NonNumericFeaturesException
- if feature vector is not compatible with values initialized
during normalization
FileNotFoundException
public final List<C> getRootClusters()
protected void writeHeader(PrintStream out, List<AttributeSettings> settings, List<String> headerInformation, C cluster)
out
- the print stream where to writesettings
- the settings to be written into the headerheaderInformation
- additional information to be printed in the header, each entry
will be printed in one separate linecluster
- the cluster to write the header for
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |