Package weka.classifiers.trees.adtree
Class PredictionNode
java.lang.Object
weka.classifiers.trees.adtree.PredictionNode
- All Implemented Interfaces:
Serializable
,Cloneable
,RevisionHandler
public final class PredictionNode
extends Object
implements Serializable, Cloneable, RevisionHandler
Class representing a prediction node in an alternating tree.
- Version:
- $Revision: 1.7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Adds a child to this node.final Enumeration
children()
Enumerates the children of this node.final Object
clone()
Clones this node.final FastVector
Gets the children of this node.Returns the revision string.final double
getValue()
Gets the prediction value of the node.final void
merge
(PredictionNode merger, ADTree mergingTo) Merges this node with another.final void
setValue
(double newValue) Sets the prediction value of the node.
-
Constructor Details
-
PredictionNode
public PredictionNode(double newValue) Creates a new prediction node.- Parameters:
newValue
- the value that the node should store
-
-
Method Details
-
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
Gets the children of this node.- Returns:
- a FastVector containing child Splitter object references
-
children
Enumerates the children of this node.- Returns:
- an enumeration of child Splitter object references
-
addChild
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
Clones this node. Performs a deep copy, recursing through the tree.- Returns:
- a clone
-
merge
Merges this node with another.- Parameters:
merger
- the node that is merging with this node - will not be affected, will instead be clonedmergingTo
- the tree that this node belongs to
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-