public class Cobweb.CNode extends java.lang.Object implements java.io.Serializable, RevisionHandler
Serializable,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Instances |
m_clusterInstances
Instances at this node
|
| Constructor and Description |
|---|
CNode(int numAttributes)
Creates an empty
CNode instance. |
CNode(int numAttributes,
Instance leafInstance)
Creates a new leaf
CNode instance. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChildNode(Cobweb.CNode child)
Adds the supplied node as a child of this node.
|
protected void |
addInstance(Instance newInstance)
Adds an instance to this cluster.
|
protected double |
categoryUtility()
Computes the utility of all children with respect to this node
|
protected double |
categoryUtilityChild(Cobweb.CNode child)
Computes the utility of a single child with respect to this node
|
protected java.lang.String |
dumpData()
Returns the instances at this node as a string.
|
protected void |
dumpTree(int depth,
java.lang.StringBuffer text)
Recursively build a string representation of the Cobweb tree
|
protected double |
getProbability(int attIndex,
int valueIndex)
Returns the probability of a value of a nominal attribute in this node
|
java.lang.String |
getRevision()
Returns the revision string.
|
protected double |
getStandardDev(int attIndex)
Returns the standard deviation of a numeric attribute
|
protected void |
graphTree(java.lang.StringBuffer text)
Recursively generate the graph string for the Cobweb tree.
|
protected void |
updateStats(Instance updateInstance,
boolean delete)
Update attribute stats using the supplied instance.
|
protected Instances m_clusterInstances
public CNode(int numAttributes)
CNode instance.numAttributes - the number of attributes in the datapublic CNode(int numAttributes,
Instance leafInstance)
CNode instance.numAttributes - the number of attributes in the dataleafInstance - the instance to store at this leafprotected void addInstance(Instance newInstance) throws java.lang.Exception
newInstance - the instance to addjava.lang.Exception - if an error occursprotected void addChildNode(Cobweb.CNode child)
child - the child to addprotected double categoryUtility()
throws java.lang.Exception
java.lang.Exception - if there are no childrenprotected double categoryUtilityChild(Cobweb.CNode child) throws java.lang.Exception
child - the child for which to compute the utilityjava.lang.Exception - if something goes wrongprotected double getProbability(int attIndex,
int valueIndex)
throws java.lang.Exception
attIndex - the index of the attributevalueIndex - the index of the value of the attributejava.lang.Exception - if the requested attribute is not nominalprotected double getStandardDev(int attIndex)
throws java.lang.Exception
attIndex - the index of the attributejava.lang.Exception - if an error occursprotected void updateStats(Instance updateInstance, boolean delete)
updateInstance - the instance for updatingdelete - true if the values of the supplied instance are to be
removed from the statisticsprotected void dumpTree(int depth,
java.lang.StringBuffer text)
depth - depth of this node in the treetext - holds the string representationprotected java.lang.String dumpData()
throws java.lang.Exception
String valuejava.lang.Exception - if an error occursprotected void graphTree(java.lang.StringBuffer text)
throws java.lang.Exception
text - holds the graph stringjava.lang.Exception - if generation failspublic java.lang.String getRevision()
getRevision in interface RevisionHandler