org.wdssii.decisiontree
Class GainRatioFitnessFunction
java.lang.Object
org.wdssii.decisiontree.GainRatioFitnessFunction
- All Implemented Interfaces:
- FitnessFunction
public class GainRatioFitnessFunction
- extends Object
- implements FitnessFunction
Picks a threshold to maximize the gain but uses gain-ratio as the fitness of
this attribute
- Author:
- lakshman
Field Summary |
private static double |
LOG2
|
Method Summary |
private float |
computeGain(GainRatioFitnessFunction.ValueAndCategory[] all,
int numCategories,
int split)
|
private float |
computeGainRatio(GainRatioFitnessFunction.ValueAndCategory[] all,
int numCategories,
int split)
|
private float |
computeInfo(GainRatioFitnessFunction.ValueAndCategory[] all,
int numCategories,
int start,
int end)
|
FitnessFunction.Split |
computeSplitAndGain(float[][] inputData,
int[] targetClass,
int numCategories,
int[] toConsider,
int attribute)
|
private static float |
log2(float p)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG2
private static double LOG2
GainRatioFitnessFunction
public GainRatioFitnessFunction()
computeSplitAndGain
public FitnessFunction.Split computeSplitAndGain(float[][] inputData,
int[] targetClass,
int numCategories,
int[] toConsider,
int attribute)
- Specified by:
computeSplitAndGain
in interface FitnessFunction
computeGain
private float computeGain(GainRatioFitnessFunction.ValueAndCategory[] all,
int numCategories,
int split)
computeInfo
private float computeInfo(GainRatioFitnessFunction.ValueAndCategory[] all,
int numCategories,
int start,
int end)
log2
private static float log2(float p)
computeGainRatio
private float computeGainRatio(GainRatioFitnessFunction.ValueAndCategory[] all,
int numCategories,
int split)