weka.classifiers.trees.m5
Class CorrelationSplitInfo

java.lang.Object
  extended byweka.classifiers.trees.m5.CorrelationSplitInfo
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, SplitEvaluate

public final class CorrelationSplitInfo
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, SplitEvaluate

Finds split points using correlation.

Version:
$Revision: 1.1 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
private  int m_first
          the first instance
private  int m_last
          the last instance
private  double m_maxImpurity
          the maximum impurity reduction
private  int m_number
          the number of instances
private  int m_position
           
private  int m_splitAttr
          the attribute being tested
private  double m_splitValue
          the best value on which to split
 
Constructor Summary
CorrelationSplitInfo(int low, int high, int attr)
          Constructs an object which contains the split information
 
Method Summary
 void attrSplit(int attr, Instances inst)
          Finds the best splitting point for an attribute in the instances
 SplitEvaluate copy()
          Makes a copy of this CorrelationSplitInfo object
 void initialize(int low, int high, int attr)
          Resets the object of split information
 double maxImpurity()
          Returns the impurity of this split
 int position()
          Returns the position of the split in the sorted values. -1 indicates that a split could not be found.
 int splitAttr()
          Returns the attribute used in this split
 double splitValue()
          Returns the split value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_first

private int m_first
the first instance


m_last

private int m_last
the last instance


m_position

private int m_position

m_maxImpurity

private double m_maxImpurity
the maximum impurity reduction


m_splitAttr

private int m_splitAttr
the attribute being tested


m_splitValue

private double m_splitValue
the best value on which to split


m_number

private int m_number
the number of instances

Constructor Detail

CorrelationSplitInfo

public CorrelationSplitInfo(int low,
                            int high,
                            int attr)
Constructs an object which contains the split information

Parameters:
low - the index of the first instance
high - the index of the last instance
attr - an attribute
Method Detail

copy

public final SplitEvaluate copy()
                         throws java.lang.Exception
Makes a copy of this CorrelationSplitInfo object

Specified by:
copy in interface SplitEvaluate
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 instance
high - the index of the last instance
attr - the attribute

attrSplit

public final void attrSplit(int attr,
                            Instances inst)
                     throws java.lang.Exception
Finds the best splitting point for an attribute in the instances

Specified by:
attrSplit in interface SplitEvaluate
Parameters:
attr - the splitting attribute
inst - the instances
Throws:
java.lang.Exception - if something goes wrong

maxImpurity

public double maxImpurity()
Returns the impurity of this split

Specified by:
maxImpurity in interface SplitEvaluate
Returns:
the impurity of this split

splitAttr

public int splitAttr()
Returns the attribute used in this split

Specified by:
splitAttr in interface SplitEvaluate
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 interface SplitEvaluate
Returns:
an int value

splitValue

public double splitValue()
Returns the split value

Specified by:
splitValue in interface SplitEvaluate
Returns:
the split value