Class GiniSplitCriterion
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.core.splitcriteria.GiniSplitCriterion
-
- All Implemented Interfaces:
Configurable
,Serializable
,SplitCriterion
,MOAObject
,OptionHandler
public class GiniSplitCriterion extends AbstractOptionHandler implements SplitCriterion
Class for computing splitting criteria using Gini with respect to distributions of class values. The split criterion is used as a parameter on decision trees and decision stumps.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description GiniSplitCriterion()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
computeGini(double[] dist)
static double
computeGini(double[] dist, double distSumOfWeights)
void
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.double
getMeritOfSplit(double[] preSplitDist, double[][] postSplitDists)
Computes the merit of splitting for a given ditribution before the split and after it.double
getRangeOfMerit(double[] preSplitDist)
Computes the range of splitting meritprotected void
prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
This method describes the implementation of how to prepare this object for use.-
Methods inherited from class moa.options.AbstractOptionHandler
copy, getCLICreationString, getOptions, getPreparedClassOption, getPurposeString, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
copy, getCLICreationString, getOptions, getPurposeString, prepareForUse, prepareForUse
-
-
-
-
Method Detail
-
getMeritOfSplit
public double getMeritOfSplit(double[] preSplitDist, double[][] postSplitDists)
Description copied from interface:SplitCriterion
Computes the merit of splitting for a given ditribution before the split and after it.- Specified by:
getMeritOfSplit
in interfaceSplitCriterion
- Parameters:
preSplitDist
- the class distribution before the splitpostSplitDists
- the class distribution after the split- Returns:
- value of the merit of splitting
-
getRangeOfMerit
public double getRangeOfMerit(double[] preSplitDist)
Description copied from interface:SplitCriterion
Computes the range of splitting merit- Specified by:
getRangeOfMerit
in interfaceSplitCriterion
- Parameters:
preSplitDist
- the class distribution before the split- Returns:
- value of the range of splitting merit
-
computeGini
public static double computeGini(double[] dist, double distSumOfWeights)
-
computeGini
public static double computeGini(double[] dist)
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
prepareForUseImpl
protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
Description copied from class:AbstractOptionHandler
This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implementprepareForUseImpl
and notprepareForUse
sinceprepareForUse
callsprepareForUseImpl
.- Specified by:
prepareForUseImpl
in classAbstractOptionHandler
- Parameters:
monitor
- the TaskMonitor to userepository
- the ObjectRepository to use
-
-