weka.classifiers.trees.adtree
Class PredictionNode

java.lang.Object
  extended byweka.classifiers.trees.adtree.PredictionNode
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class PredictionNode
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Class representing a prediction node in an alternating tree.

Version:
$Revision: 1.4 $
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
private  FastVector children
          The children of this node - any number of splitter nodes
private  double value
          The prediction value stored in this node
 
Constructor Summary
PredictionNode(double newValue)
          Creates a new prediction node.
 
Method Summary
 void addChild(Splitter newChild, ADTree addingTo)
          Adds a child to this node.
 java.util.Enumeration children()
          Enumerates the children of this node.
 java.lang.Object clone()
          Clones this node.
 FastVector getChildren()
          Gets the children of this node.
 double getValue()
          Gets the prediction value of the node.
 void merge(PredictionNode merger, ADTree mergingTo)
          Merges this node with another.
private  void setOrderAddedSubtree(Splitter addChild, ADTree addingTo)
          Sets the order added values of the subtree rooted at this splitter node.
 void setValue(double newValue)
          Sets the prediction value of the node.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private double value
The prediction value stored in this node


children

private FastVector children
The children of this node - any number of splitter nodes

Constructor Detail

PredictionNode

public PredictionNode(double newValue)
Creates a new prediction node.

Parameters:
newValue - the value that the node should store
Method Detail

setValue

public final void setValue(double newValue)
Sets the prediction value of the node.

Parameters:
newValue - the value that the node should store

getValue

public final double getValue()
Gets the prediction value of the node.

Returns:
the value stored in the node

getChildren

public final FastVector getChildren()
Gets the children of this node.

Returns:
a FastVector containing child Splitter object references

children

public final java.util.Enumeration children()
Enumerates the children of this node.

Returns:
an enumeration of child Splitter object references

addChild

public final void addChild(Splitter newChild,
                           ADTree addingTo)
Adds a child to this node. If possible will merge, and will perform a deep copy of the child tree.

Parameters:
newChild - the new child to add (will be cloned)
addingTo - the tree that this node belongs to

clone

public final java.lang.Object clone()
Clones this node. Performs a deep copy, recursing through the tree.

Returns:
a clone

merge

public final void merge(PredictionNode merger,
                        ADTree mergingTo)
Merges this node with another.

Parameters:
merger - the node that is merging with this node - will not be affected, will instead be cloned
mergingTo - the tree that this node belongs to

setOrderAddedSubtree

private final void setOrderAddedSubtree(Splitter addChild,
                                        ADTree addingTo)
Sets the order added values of the subtree rooted at this splitter node.

Parameters:
addChild - the root of the subtree
addingTo - the tree that this node will belong to