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.
|
String |
debugTipText()
Returns the tip text for this property
|
String |
distanceFunctionTipText() |
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() |
String[] |
getOptions()
Gets the current settings of the clusterer.
|
boolean |
getPrintNewick() |
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
This will return a string describing the clusterer.
|
String |
graph()
Returns a string that describes a graph representing
the object.
|
int |
graphType()
Returns the type of graph representing
the object.
|
String |
linkTypeTipText() |
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv) |
int |
numberOfClusters()
Returns the number of clusters.
|
String |
numClustersTipText() |
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(String[] options)
Parses a given list of options.
|
void |
setPrintNewick(boolean bPrintNewick) |
String |
toString() |
forName, makeCopies, makeCopy, runClustererpublic 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 Exception
AbstractClustererbuildClusterer in interface ClustererbuildClusterer in class AbstractClustererdata - set of instances serving as training dataException - if the clusterer has not been
generated successfullypublic int clusterInstance(Instance instance) throws Exception
AbstractClustererclusterInstance in interface ClustererclusterInstance in class AbstractClustererinstance - the instance to be assigned to a clusterException - if instance could not be clustered
successfullypublic double[] distributionForInstance(Instance instance) throws Exception
AbstractClustererdistributionForInstance in interface ClustererdistributionForInstance in class AbstractClustererinstance - the instance to be assigned a cluster.Exception - if distribution could not be
computed successfullypublic Capabilities getCapabilities()
AbstractClusterergetCapabilities in interface ClusterergetCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractClustererCapabilitiespublic int numberOfClusters()
throws Exception
AbstractClusterernumberOfClusters in interface ClusterernumberOfClusters in class AbstractClustererException - if number of clusters could not be returned
successfullypublic Enumeration listOptions()
listOptions in interface OptionHandlerpublic void setOptions(String[] options) throws Exception
setOptions in interface OptionHandleroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlerpublic void setDebug(boolean debug)
debug - true if debug output should be printedpublic boolean getDebug()
public boolean getDistanceIsBranchLength()
public void setDistanceIsBranchLength(boolean bDistanceIsHeight)
public String distanceIsBranchLengthTipText()
public String debugTipText()
public String numClustersTipText()
public String printNewickTipText()
public String distanceFunctionTipText()
public String linkTypeTipText()
public String globalInfo()
public static void main(String[] argv)
public String graph() throws Exception
Drawablepublic int graphType()
Drawablepublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClustererCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.