weka.classifiers.trees.m5
Class Impurity
java.lang.Object
weka.classifiers.trees.m5.Impurity
- public final class Impurity
- extends java.lang.Object
Class for handling the impurity values when spliting the instances
- Version:
- $Revision: 1.6 $
- Author:
- Yong Wang (yongwang@cs.waikato.ac.nz)
Field Summary |
(package private) int |
attr
|
(package private) double |
impurity
|
(package private) double |
n
|
(package private) double |
nl
|
(package private) double |
nr
|
(package private) int |
order
|
(package private) double |
s2l
|
(package private) double |
s2r
|
(package private) double |
sd
|
(package private) double |
sdl
|
(package private) double |
sdr
|
(package private) double |
sl
|
(package private) double |
sr
|
(package private) double |
va
|
(package private) double |
vl
|
(package private) double |
vr
|
Constructor Summary |
Impurity(int partition,
int attribute,
Instances inst,
int k)
Constructs an Impurity object containing the impurity values of partitioning the instances using an attribute |
Method Summary |
void |
incremental(double value,
int type)
Incrementally computes the impurirty values |
java.lang.String |
toString()
Converts an Impurity object to a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
n
double n
attr
int attr
nl
double nl
nr
double nr
sl
double sl
sr
double sr
s2l
double s2l
s2r
double s2r
sdl
double sdl
sdr
double sdr
vl
double vl
vr
double vr
sd
double sd
va
double va
impurity
double impurity
order
int order
Impurity
public Impurity(int partition,
int attribute,
Instances inst,
int k)
- Constructs an Impurity object containing the impurity values of partitioning the instances using an attribute
- Parameters:
partition
- the index of the last instance in the left subsetattribute
- the attribute used in partitioninginst
- instancesk
- the order of the impurity; =1, the variance; =2, the stardard deviation; =k, the k-th order root of the variance
toString
public final java.lang.String toString()
- Converts an Impurity object to a string
- Returns:
- the converted string
incremental
public final void incremental(double value,
int type)
- Incrementally computes the impurirty values
- Parameters:
value
- the incremental valuetype
- if type=1, value will be added to the left subset; type=-1, to the right subset; type=0, initializes