com.rapidminer.operator.learner.tree
Class InfoGainCriterion

java.lang.Object
  extended by com.rapidminer.operator.learner.tree.AbstractCriterion
      extended by com.rapidminer.operator.learner.tree.InfoGainCriterion
All Implemented Interfaces:
Criterion, MinimalGainHandler
Direct Known Subclasses:
GainRatioCriterion

public class InfoGainCriterion
extends AbstractCriterion
implements MinimalGainHandler

This criterion implements the well known information gain in order to calculate the benefit of a split. The information gain is defined as the change in entropy from a prior state to a state that takes some information as given by the entropy.

Author:
Sebastian Land, Ingo Mierswa

Field Summary
 
Fields inherited from class com.rapidminer.operator.learner.tree.AbstractCriterion
labelAttribute, leftLabelWeights, leftWeight, rightLabelWeights, rightWeight, totalLabelWeights, totalWeight, weightAttribute
 
Constructor Summary
InfoGainCriterion()
           
InfoGainCriterion(double minimalGain)
           
 
Method Summary
protected  double getBenefit(double[][] weightCounts)
           
protected  double getEntropy(double[] labelWeights, double totalWeight)
           
 double getIncrementalBenefit()
           
 double getNominalBenefit(ExampleSet exampleSet, Attribute attribute)
           
 double getNumericalBenefit(ExampleSet exampleSet, Attribute attribute, double splitValue)
           
 void setMinimalGain(double minimalGain)
           
 boolean supportsIncrementalCalculation()
           
 
Methods inherited from class com.rapidminer.operator.learner.tree.AbstractCriterion
startIncrementalCalculation, swapExample
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoGainCriterion

public InfoGainCriterion()

InfoGainCriterion

public InfoGainCriterion(double minimalGain)
Method Detail

setMinimalGain

public void setMinimalGain(double minimalGain)
Specified by:
setMinimalGain in interface MinimalGainHandler

getNominalBenefit

public double getNominalBenefit(ExampleSet exampleSet,
                                Attribute attribute)
Specified by:
getNominalBenefit in interface Criterion

getNumericalBenefit

public double getNumericalBenefit(ExampleSet exampleSet,
                                  Attribute attribute,
                                  double splitValue)
Specified by:
getNumericalBenefit in interface Criterion

getBenefit

protected double getBenefit(double[][] weightCounts)

getEntropy

protected double getEntropy(double[] labelWeights,
                            double totalWeight)

supportsIncrementalCalculation

public boolean supportsIncrementalCalculation()
Specified by:
supportsIncrementalCalculation in interface Criterion
Overrides:
supportsIncrementalCalculation in class AbstractCriterion

getIncrementalBenefit

public double getIncrementalBenefit()
Specified by:
getIncrementalBenefit in interface Criterion
Overrides:
getIncrementalBenefit in class AbstractCriterion


Copyright © 2001-2009 by Rapid-I