Package weka.classifiers.trees.m5
Class YongSplitInfo
java.lang.Object
weka.classifiers.trees.m5.YongSplitInfo
- All Implemented Interfaces:
Serializable
,Cloneable
,SplitEvaluate
,RevisionHandler
public final class YongSplitInfo
extends Object
implements Cloneable, Serializable, SplitEvaluate, RevisionHandler
Stores split information.
- Version:
- $Revision: 11269 $
- Author:
- Yong Wang (yongwang@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
ConstructorDescriptionYongSplitInfo
(int low, int high, int attr) Constructs an object which contains the split information -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Finds the best splitting point for an attribute in the instancesfinal SplitEvaluate
copy()
Makes a copy of this SplitInfo objectReturns the revision string.final void
initialize
(int low, int high, int attr) Resets the object of split informationdouble
Returns the impurity of this splitint
position()
Returns the position of the split in the sorted values.int
Returns the attribute used in this splitdouble
Returns the split valuefinal String
Converts the spliting information to string
-
Constructor Details
-
YongSplitInfo
public YongSplitInfo(int low, int high, int attr) Constructs an object which contains the split information- Parameters:
low
- the index of the first instancehigh
- the index of the last instanceattr
- an attribute
-
-
Method Details
-
copy
Makes a copy of this SplitInfo object- Specified by:
copy
in interfaceSplitEvaluate
- Returns:
- a copy of the object
- Throws:
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
Converts the spliting information to string- Parameters:
inst
- the instances
-
attrSplit
Finds the best splitting point for an attribute in the instances- Specified by:
attrSplit
in interfaceSplitEvaluate
- Parameters:
attr
- the splitting attributeinst
- the instances- Throws:
Exception
- if something goes wrong
-
maxImpurity
public double maxImpurity()Returns the impurity of this split- Specified by:
maxImpurity
in interfaceSplitEvaluate
- Returns:
- the impurity of this split
-
splitAttr
public int splitAttr()Returns the attribute used in this split- Specified by:
splitAttr
in 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:
position
in interfaceSplitEvaluate
- Returns:
- an
int
value
-
splitValue
public double splitValue()Returns the split value- Specified by:
splitValue
in interfaceSplitEvaluate
- Returns:
- the split value
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-