weka.clusterers
Class Cobweb

java.lang.Object
  |
  +--weka.clusterers.Clusterer
        |
        +--weka.clusterers.Cobweb
All Implemented Interfaces:
java.lang.Cloneable, OptionHandler, java.io.Serializable

public class Cobweb
extends Clusterer
implements OptionHandler

See Also:
Serialized Form

Constructor Summary
Cobweb()
           
 
Method Summary
 void add(weka.clusterers.Cobweb.CTree node, weka.clusterers.Cobweb.CTree tree)
          Adds an example to the tree.
 weka.clusterers.Cobweb.CTree bestHost(weka.clusterers.Cobweb.CTree tree, weka.clusterers.Cobweb.CTree node, double aU, double baseU)
          Finds the best place to add a new node during training.
 weka.clusterers.Cobweb.CTree bestHostCluster(weka.clusterers.Cobweb.CTree tree, weka.clusterers.Cobweb.CTree node, double aU, double baseU)
          Finds the cluster that an unseen instance belongs to.
 void buildClusterer(Instances data)
          Builds the clusterer.
 int clusterInstance(Instance instance)
          Clusters an instance.
 int getAcuity()
          get the accuity value
 int getCutoff()
          get the cutoff
 java.lang.String[] getOptions()
          Gets the current settings of Cobweb.
 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.
 void setAcuity(int a)
          set the accuity.
 void setCutoff(int c)
          set the cutoff
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 java.lang.String toString()
          Returns a description of the clusterer as a string.
 
Methods inherited from class weka.clusterers.Clusterer
forName, makeCopies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cobweb

public Cobweb()
Method Detail

buildClusterer

public void buildClusterer(Instances data)
                    throws java.lang.Exception
Builds the clusterer.
Overrides:
buildClusterer in class Clusterer
Parameters:
data - the training instances.
Throws:
java.lang.Exception - if something goes wrong.

numberOfClusters

public int numberOfClusters()
                     throws java.lang.Exception
Returns the number of clusters.
Overrides:
numberOfClusters in class Clusterer
Throws:
java.lang.Exception - if something goes wrong.

clusterInstance

public int clusterInstance(Instance instance)
                    throws java.lang.Exception
Clusters an instance.
Overrides:
clusterInstance in class Clusterer
Parameters:
instance - the instance to cluster.
Throws:
java.lang.Exception - if something goes wrong.

add

public void add(weka.clusterers.Cobweb.CTree node,
                weka.clusterers.Cobweb.CTree tree)
         throws java.lang.Exception
Adds an example to the tree.
Parameters:
node - the node to be added.
tree - the tree.
Throws:
java.lang.Exception - if something goes wrong.

bestHostCluster

public weka.clusterers.Cobweb.CTree bestHostCluster(weka.clusterers.Cobweb.CTree tree,
                                                    weka.clusterers.Cobweb.CTree node,
                                                    double aU,
                                                    double baseU)
                                             throws java.lang.Exception
Finds the cluster that an unseen instance belongs to.
Parameters:
tree - the tree.
node - the node to be added.
aU - ??
baseU - ??
Throws:
java.lang.Exception - if something goes wrong.

bestHost

public weka.clusterers.Cobweb.CTree bestHost(weka.clusterers.Cobweb.CTree tree,
                                             weka.clusterers.Cobweb.CTree node,
                                             double aU,
                                             double baseU)
                                      throws java.lang.Exception
Finds the best place to add a new node during training.
Parameters:
tree - the tree.
node - the node to be added.
aU - ??
baseU - ??
Throws:
java.lang.Exception - if something goes wrong.

toString

public java.lang.String toString()
Returns a description of the clusterer as a string.
Overrides:
toString in class java.lang.Object
Returns:
a string describing the clusterer.

listOptions

public java.util.Enumeration listOptions()
Returns an enumeration describing the available options
Specified by:
listOptions in interface OptionHandler
Returns:
an enumeration of all the available options

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Parses a given list of options. Valid options are:

-A <0-100>
Acuity.

-C <0-100>
Cutoff.

Specified by:
setOptions in interface OptionHandler
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported

setAcuity

public void setAcuity(int a)
set the accuity.
Parameters:
a - the accuity between 0 and 100

getAcuity

public int getAcuity()
get the accuity value
Returns:
the accuity as a value between 0 and 100

setCutoff

public void setCutoff(int c)
set the cutoff
Parameters:
c - the cutoff between 0 and 100

getCutoff

public int getCutoff()
get the cutoff
Returns:
the cutoff as a value between 1 and 100\

getOptions

public java.lang.String[] getOptions()
Gets the current settings of Cobweb.
Specified by:
getOptions in interface OptionHandler
Returns:
an array of strings suitable for passing to setOptions()

main

public static void main(java.lang.String[] argv)