weka.classifiers.trees.j48
Class GainRatioSplitCrit

java.lang.Object
  extended byweka.classifiers.trees.j48.SplitCriterion
      extended byweka.classifiers.trees.j48.EntropyBasedSplitCrit
          extended byweka.classifiers.trees.j48.GainRatioSplitCrit
All Implemented Interfaces:
java.io.Serializable

public final class GainRatioSplitCrit
extends EntropyBasedSplitCrit

Class for computing the gain ratio for a given distribution.

Version:
$Revision: 1.5 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.classifiers.trees.j48.EntropyBasedSplitCrit
log2
 
Constructor Summary
GainRatioSplitCrit()
           
 
Method Summary
 double splitCritValue(Distribution bags)
          This method is a straightforward implementation of the gain ratio criterion for the given distribution.
 double splitCritValue(Distribution bags, double totalnoInst, double numerator)
          This method computes the gain ratio in the same way C4.5 does.
private  double splitEnt(Distribution bags, double totalnoInst)
          Help method for computing the split entropy.
 
Methods inherited from class weka.classifiers.trees.j48.EntropyBasedSplitCrit
logFunc, newEnt, oldEnt, splitEnt
 
Methods inherited from class weka.classifiers.trees.j48.SplitCriterion
splitCritValue, splitCritValue, splitCritValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GainRatioSplitCrit

public GainRatioSplitCrit()
Method Detail

splitCritValue

public final double splitCritValue(Distribution bags)
This method is a straightforward implementation of the gain ratio criterion for the given distribution.

Overrides:
splitCritValue in class SplitCriterion
Returns:
value of splitting criterion. 0 by default

splitCritValue

public final double splitCritValue(Distribution bags,
                                   double totalnoInst,
                                   double numerator)
This method computes the gain ratio in the same way C4.5 does.

Parameters:
bags - the distribution
totalnoInst - the weight of ALL instances
numerator - the info gain

splitEnt

private final double splitEnt(Distribution bags,
                              double totalnoInst)
Help method for computing the split entropy.