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

Class weka.classifiers.adtree.Splitter

java.lang.Object
   |
   +----weka.classifiers.adtree.Splitter

public abstract class Splitter
extends Object
implements Serializable, Cloneable
Abstract class representing a splitter node in an alternating tree.

Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)

Variable Index

 o orderAdded
The number this node was in the order of nodes added to the tree

Constructor Index

 o Splitter()

Method Index

 o attributeString(Instances)
Gets the string describing the attributes the split depends on.
 o branchInstanceGoesDown(Instance)
Gets the index of the branch that an instance applies to.
 o clone()
Clones this node.
 o comparisonString(int, Instances)
Gets the string describing the comparision the split depends on for a particular branch.
 o equalTo(Splitter)
Tests whether two splitters are equivalent.
 o getChildForBranch(int)
Gets the child for a branch of the split.
 o getNumOfBranches()
Gets the number of branches of the split.
 o instancesDownBranch(int, Instances)
Gets the subset of instances that apply to a particluar branch of the split.
 o setChildForBranch(int, PredictionNode)
Sets the child for a branch of the split.

Variables

 o orderAdded
 public int orderAdded
The number this node was in the order of nodes added to the tree

Constructors

 o Splitter
 public Splitter()

Methods

 o getNumOfBranches
 public abstract int getNumOfBranches()
Gets the number of branches of the split.

Returns:
the number of branches
 o branchInstanceGoesDown
 public abstract int branchInstanceGoesDown(Instance i)
Gets the index of the branch that an instance applies to. Returns -1 if no branches apply.

Parameters:
i - the instance
Returns:
the branch index
 o instancesDownBranch
 public abstract ReferenceInstances instancesDownBranch(int branch,
                                                        Instances sourceInstances)
Gets the subset of instances that apply to a particluar branch of the split. If the branch index is -1, the subset will consist of those instances that don't apply to any branch.

Parameters:
branch - the index of the branch
sourceInstances - the instances from which to find the subset
Returns:
the set of instances that apply
 o attributeString
 public abstract String attributeString(Instances dataset)
Gets the string describing the attributes the split depends on. i.e. the left hand side of the description of the split.

Parameters:
dataset - the dataset that the split is based on
Returns:
a string describing the attributes
 o comparisonString
 public abstract String comparisonString(int branchNum,
                                         Instances dataset)
Gets the string describing the comparision the split depends on for a particular branch. i.e. the right hand side of the description of the split.

Parameters:
branchNum - the branch of the split
dataset - the dataset that the split is based on
Returns:
a string describing the comparison
 o equalTo
 public abstract boolean equalTo(Splitter compare)
Tests whether two splitters are equivalent.

Parameters:
compare - the splitter to compare with
Returns:
whether or not they match
 o setChildForBranch
 public abstract void setChildForBranch(int branchNum,
                                        PredictionNode childPredictor)
Sets the child for a branch of the split.

Parameters:
branchNum - the branch to set the child for
childPredictor - the new child
 o getChildForBranch
 public abstract PredictionNode getChildForBranch(int branchNum)
Gets the child for a branch of the split.

Parameters:
branchNum - the branch to get the child for
Returns:
the child
 o clone
 public abstract Object clone()
Clones this node. Performs a deep copy, recursing through the tree.

Returns:
a clone
Overrides:
clone in class Object

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