public class HierarchicalClusterer extends AbstractClusterer implements OptionHandler, CapabilitiesHandler, Drawable
-N number of clusters
-L Link type (Single, Complete, Average, Mean, Centroid, Ward, Adjusted complete, Neighbor Joining) [SINGLE|COMPLETE|AVERAGE|MEAN|CENTROID|WARD|ADJCOMLPETE|NEIGHBOR_JOINING]
-A Distance function to use. (default: weka.core.EuclideanDistance)
-P Print hierarchy in Newick format, which can be used for display in other programs.
-D If set, classifier is run in debug mode and may output additional info to the console.
-B \If set, distance is interpreted as branch length, otherwise it is node height.
Modifier and Type | Field and Description |
---|---|
static Tag[] |
TAGS_LINK_TYPE |
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
HierarchicalClusterer() |
Modifier and Type | Method and Description |
---|---|
void |
buildClusterer(Instances data)
Generates a clusterer.
|
int |
clusterInstance(Instance instance)
Classifies a given instance.
|
java.lang.String |
debugTipText()
Returns the tip text for this property
|
java.lang.String |
distanceFunctionTipText() |
java.lang.String |
distanceIsBranchLengthTipText() |
double[] |
distributionForInstance(Instance instance)
Predicts the cluster memberships for a given instance.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this clusterer.
|
boolean |
getDebug()
Get whether debugging is turned on.
|
DistanceFunction |
getDistanceFunction() |
boolean |
getDistanceIsBranchLength() |
SelectedTag |
getLinkType() |
int |
getNumClusters() |
java.lang.String[] |
getOptions()
Gets the current settings of the clusterer.
|
boolean |
getPrintNewick() |
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
This will return a string describing the clusterer.
|
java.lang.String |
graph()
Returns a string that describes a graph representing
the object.
|
int |
graphType()
Returns the type of graph representing
the object.
|
java.lang.String |
linkTypeTipText() |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv) |
int |
numberOfClusters()
Returns the number of clusters.
|
java.lang.String |
numClustersTipText() |
java.lang.String |
printNewickTipText() |
void |
setDebug(boolean debug)
Set debugging mode.
|
void |
setDistanceFunction(DistanceFunction distanceFunction) |
void |
setDistanceIsBranchLength(boolean bDistanceIsHeight) |
void |
setLinkType(SelectedTag newLinkType) |
void |
setNumClusters(int nClusters) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setPrintNewick(boolean bPrintNewick) |
java.lang.String |
toString() |
forName, makeCopies, makeCopy
public static final Tag[] TAGS_LINK_TYPE
public void setNumClusters(int nClusters)
public int getNumClusters()
public DistanceFunction getDistanceFunction()
public void setDistanceFunction(DistanceFunction distanceFunction)
public boolean getPrintNewick()
public void setPrintNewick(boolean bPrintNewick)
public void setLinkType(SelectedTag newLinkType)
public SelectedTag getLinkType()
public void buildClusterer(Instances data) throws java.lang.Exception
AbstractClusterer
buildClusterer
in interface Clusterer
buildClusterer
in class AbstractClusterer
data
- set of instances serving as training datajava.lang.Exception
- if the clusterer has not been
generated successfullypublic int clusterInstance(Instance instance) throws java.lang.Exception
AbstractClusterer
clusterInstance
in interface Clusterer
clusterInstance
in class AbstractClusterer
instance
- the instance to be assigned to a clusterjava.lang.Exception
- if instance could not be clustered
successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
AbstractClusterer
distributionForInstance
in interface Clusterer
distributionForInstance
in class AbstractClusterer
instance
- the instance to be assigned a cluster.java.lang.Exception
- if distribution could not be
computed successfullypublic Capabilities getCapabilities()
AbstractClusterer
getCapabilities
in interface Clusterer
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClusterer
Capabilities
public int numberOfClusters() throws java.lang.Exception
AbstractClusterer
numberOfClusters
in interface Clusterer
numberOfClusters
in class AbstractClusterer
java.lang.Exception
- if number of clusters could not be returned
successfullypublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String toString()
toString
in class java.lang.Object
public void setDebug(boolean debug)
debug
- true if debug output should be printedpublic boolean getDebug()
public boolean getDistanceIsBranchLength()
public void setDistanceIsBranchLength(boolean bDistanceIsHeight)
public java.lang.String distanceIsBranchLengthTipText()
public java.lang.String debugTipText()
public java.lang.String numClustersTipText()
public java.lang.String printNewickTipText()
public java.lang.String distanceFunctionTipText()
public java.lang.String linkTypeTipText()
public java.lang.String globalInfo()
public static void main(java.lang.String[] argv)
public java.lang.String graph() throws java.lang.Exception
Drawable
public int graphType()
Drawable
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer