|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.trees.adtree.Splitter
weka.classifiers.trees.adtree.TwoWayNumericSplit
Class representing a two-way split on a numeric attribute, of the form: either 'is < some_value' or 'is >= some_value'.
Field Summary | |
private int |
attIndex
The index of the attribute the split depends on |
private PredictionNode[] |
children
The children of this split |
private double |
splitPoint
The attribute value that is compared against |
Fields inherited from class weka.classifiers.trees.adtree.Splitter |
orderAdded |
Constructor Summary | |
TwoWayNumericSplit(int _attIndex,
double _splitPoint)
Creates a new two-way numeric splitter. |
Method Summary | |
java.lang.String |
attributeString(Instances dataset)
Gets the string describing the attributes the split depends on. |
int |
branchInstanceGoesDown(Instance inst)
Gets the index of the branch that an instance applies to. |
java.lang.Object |
clone()
Clones this node. |
java.lang.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. |
boolean |
equalTo(Splitter compare)
Tests whether two splitters are equivalent. |
PredictionNode |
getChildForBranch(int branchNum)
Gets the child for a branch of the split. |
int |
getNumOfBranches()
Gets the number of branches of the split. |
ReferenceInstances |
instancesDownBranch(int branch,
Instances instances)
Gets the subset of instances that apply to a particluar branch of the split. |
void |
setChildForBranch(int branchNum,
PredictionNode childPredictor)
Sets the child for a branch of the split. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int attIndex
private double splitPoint
private PredictionNode[] children
Constructor Detail |
public TwoWayNumericSplit(int _attIndex, double _splitPoint)
_attIndex
- the index of the attribute this split depeneds on_splitPoint
- the attribute value that the splitter splits onMethod Detail |
public int getNumOfBranches()
getNumOfBranches
in class Splitter
public int branchInstanceGoesDown(Instance inst)
branchInstanceGoesDown
in class Splitter
inst
- the instance
public ReferenceInstances instancesDownBranch(int branch, Instances instances)
instancesDownBranch
in class Splitter
branch
- the index of the branchinstances
- the instances from which to find the subset
public java.lang.String attributeString(Instances dataset)
attributeString
in class Splitter
dataset
- the dataset that the split is based on
public java.lang.String comparisonString(int branchNum, Instances dataset)
comparisonString
in class Splitter
branchNum
- the branch of the splitdataset
- the dataset that the split is based on
public boolean equalTo(Splitter compare)
equalTo
in class Splitter
compare
- the splitter to compare with
public void setChildForBranch(int branchNum, PredictionNode childPredictor)
setChildForBranch
in class Splitter
branchNum
- the branch to set the child forchildPredictor
- the new childpublic PredictionNode getChildForBranch(int branchNum)
getChildForBranch
in class Splitter
branchNum
- the branch to get the child for
public java.lang.Object clone()
clone
in class Splitter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |