Package weka.classifiers.trees.m5
Class YongSplitInfo
- java.lang.Object
-
- weka.classifiers.trees.m5.YongSplitInfo
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,SplitEvaluate,RevisionHandler
public final class YongSplitInfo extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, SplitEvaluate, RevisionHandler
Stores split information.- Version:
- $Revision: 1.4 $
- Author:
- Yong Wang (yongwang@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description YongSplitInfo(int low, int high, int attr)Constructs an object which contains the split information
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattrSplit(int attr, Instances inst)Finds the best splitting point for an attribute in the instancesSplitEvaluatecopy()Makes a copy of this SplitInfo objectjava.lang.StringgetRevision()Returns the revision string.voidinitialize(int low, int high, int attr)Resets the object of split informationdoublemaxImpurity()Returns the impurity of this splitintposition()Returns the position of the split in the sorted values.intsplitAttr()Returns the attribute used in this splitdoublesplitValue()Returns the split valuejava.lang.StringtoString(Instances inst)Converts the spliting information to string
-
-
-
Method Detail
-
copy
public final SplitEvaluate copy() throws java.lang.Exception
Makes a copy of this SplitInfo object- Specified by:
copyin interfaceSplitEvaluate- Returns:
- a copy of the object
- Throws:
java.lang.Exception
-
initialize
public final void initialize(int low, int high, int attr)Resets the object of split information- Parameters:
low- the index of the first instancehigh- the index of the last instanceattr- the attribute
-
toString
public final java.lang.String toString(Instances inst)
Converts the spliting information to string- Parameters:
inst- the instances
-
attrSplit
public final void attrSplit(int attr, Instances inst) throws java.lang.ExceptionFinds the best splitting point for an attribute in the instances- Specified by:
attrSplitin interfaceSplitEvaluate- Parameters:
attr- the splitting attributeinst- the instances- Throws:
java.lang.Exception- if something goes wrong
-
maxImpurity
public double maxImpurity()
Returns the impurity of this split- Specified by:
maxImpurityin interfaceSplitEvaluate- Returns:
- the impurity of this split
-
splitAttr
public int splitAttr()
Returns the attribute used in this split- Specified by:
splitAttrin interfaceSplitEvaluate- Returns:
- the attribute used in this split
-
position
public int position()
Returns the position of the split in the sorted values. -1 indicates that a split could not be found.- Specified by:
positionin interfaceSplitEvaluate- Returns:
- an
intvalue
-
splitValue
public double splitValue()
Returns the split value- Specified by:
splitValuein interfaceSplitEvaluate- Returns:
- the split value
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-