All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.clusterers.Cobweb

java.lang.Object
    |
    +----weka.clusterers.Clusterer
            |
            +----weka.clusterers.Cobweb

public class Cobweb
extends Clusterer
implements OptionHandler, Drawable
Class implementing the Cobweb and Classit clustering algorithms.

Note: the application of node operators (merging, splitting etc.) in terms of ordering and priority differs (and is somewhat ambiguous) between the original Cobweb and Classit papers. This algorithm always compares the best host, adding a new leaf, merging the two best hosts, and splitting the best host when considering where to place a new instance.

Valid options are:

-A
Acuity.

-C
Cutoff.

Version:
$Revision: 1.10.2.2 $
Author:
Mark Hall
See Also:
Clusterer, OptionHandler, Drawable

Constructor Index

 o Cobweb()
 

Method Index

 o acuityTipText()
Returns the tip text for this property
 o addInstance(Instance)
Adds an instance to the Cobweb tree.
 o buildClusterer(Instances)
Builds the clusterer.
 o clusterInstance(Instance)
Classifies a given instance.
 o cutoffTipText()
Returns the tip text for this property
 o getAcuity()
get the acuity value
 o getCutoff()
get the cutoff
 o getOptions()
Gets the current settings of Cobweb.
 o getSaveInstanceData()
Get the value of saveInstances.
 o graph()
Generates the graph string of the Cobweb tree
 o listOptions()
Returns an enumeration describing the available options.
 o main(String[])
 
 o numberOfClusters()
Returns the number of clusters.
 o saveInstanceDataTipText()
Returns the tip text for this property
 o setAcuity(double)
set the acuity.
 o setCutoff(double)
set the cutoff
 o setOptions(String[])
Parses a given list of options.
 o setSaveInstanceData(boolean)
Set the value of saveInstances.
 o toString()
Returns a description of the clusterer as a string.

Constructor Detail

 o Cobweb
public Cobweb()

Method Detail

 o buildClusterer
public void buildClusterer(Instances data) throws java.lang.Exception
          Builds the clusterer.
Parameters:
data - the training instances.
Throws:
java.lang.Exception - if something goes wrong.
Overrides:
buildClusterer in class Clusterer
 o clusterInstance
public int clusterInstance(Instance instance) throws java.lang.Exception
          Classifies a given instance.
Parameters:
instance - the instance to be assigned to a cluster
Returns:
the number of the assigned cluster as an interger if the class is enumerated, otherwise the predicted value
Throws:
java.lang.Exception - if instance could not be classified successfully
Overrides:
clusterInstance in class Clusterer
 o numberOfClusters
public int numberOfClusters() throws java.lang.Exception
          Returns the number of clusters.
Throws:
java.lang.Exception - if something goes wrong.
Overrides:
numberOfClusters in class Clusterer
 o addInstance
public void addInstance(Instance newInstance) throws java.lang.Exception
          Adds an instance to the Cobweb tree.
Parameters:
newInstance - the instance to be added
Throws:
java.lang.Exception - if something goes wrong
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
Returns:
an enumeration of all the available options.
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-A
Acuity.

-C
Cutoff.

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o acuityTipText
public java.lang.String acuityTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setAcuity
public void setAcuity(double a)
          set the acuity.
Parameters:
a - the acuity value
 o getAcuity
public double getAcuity()
          get the acuity value
Returns:
the acuity
 o cutoffTipText
public java.lang.String cutoffTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setCutoff
public void setCutoff(double c)
          set the cutoff
Parameters:
c - the cutof
 o getCutoff
public double getCutoff()
          get the cutoff
Returns:
the cutoff
 o saveInstanceDataTipText
public java.lang.String saveInstanceDataTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getSaveInstanceData
public boolean getSaveInstanceData()
          Get the value of saveInstances.
Returns:
Value of saveInstances.
 o setSaveInstanceData
public void setSaveInstanceData(boolean newsaveInstances)
          Set the value of saveInstances.
Parameters:
newsaveInstances - Value to assign to saveInstances.
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of Cobweb.
Returns:
an array of strings suitable for passing to setOptions()
 o toString
public java.lang.String toString()
          Returns a description of the clusterer as a string.
Returns:
a string describing the clusterer.
Overrides:
toString in class java.lang.Object
 o graph
public java.lang.String graph() throws java.lang.Exception
          Generates the graph string of the Cobweb tree
Returns:
a String value
Throws:
java.lang.Exception - if an error occurs
 o main
public static void main(java.lang.String argv[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home