cc.mallet.types
Class GainRatio
- java.lang.Object
-
- cc.mallet.types.SparseVector
-
- cc.mallet.types.FeatureVector
-
- cc.mallet.types.RankedFeatureVector
-
- cc.mallet.types.GainRatio
-
- All Implemented Interfaces:
- AlphabetCarrying, ConstantMatrix, Vector, java.io.Serializable
public class GainRatio extends RankedFeatureVector
List of features along with their thresholds sorted in descending order of the ratio of (1) information gained by splitting instances on the feature at its associated threshold value, to (2) the split information.The calculations performed do not take into consideration the instance weights.
To create an instance of GainRatio from an InstanceList, one must do the following:
InstanceList ilist = ... ... GainRatio gr = GainRatio.createGainRatio(ilist);
J. R. Quinlan "Improved Use of Continuous Attributes in C4.5" ftp://ftp.cs.cmu.edu/project/jair/volume4/quinlan96a.ps
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class cc.mallet.types.RankedFeatureVector
RankedFeatureVector.Factory, RankedFeatureVector.PerLabelFactory
-
-
Field Summary
Fields Modifier and Type Field and Description static doublelog2
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static GainRatiocreateGainRatio(InstanceList ilist)Constructs a GainRatio object.static GainRatiocreateGainRatio(InstanceList ilist, int[] instIndices, int minNumInsts)Constructs a GainRatio objectdoublegetBaseEntropy()LabelVectorgetBaseLabelDistribution()doublegetMaxValuedThreshold()intgetNumSplitPointsForBestFeature()doublegetThresholdAtRank(int rank)static int[]sortInstances(InstanceList ilist, int[] instIndices, int featureIndex)-
Methods inherited from class cc.mallet.types.RankedFeatureVector
getIndexAtRank, getMaxValue, getMaxValuedIndex, getMaxValuedIndexIn, getMaxValuedObject, getMaxValuedObjectIn, getMaxValueIn, getObjectAtRank, getRank, getRank, getValueAtRank, printByRank, printByRank, printLowerK, printTopK, set
-
Methods inherited from class cc.mallet.types.FeatureVector
alphabetsMatch, cloneMatrix, cloneMatrixZeroed, contains, getAlphabet, getAlphabets, getObjectIndices, location, newFeatureVector, toSimpFile, toString, toString, value
-
Methods inherited from class cc.mallet.types.SparseVector
absNorm, addTo, addTo, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, indexAtLocation, infinityNorm, isBinary, isInfinite, isNaN, isNaNOrInfinite, location, makeBinary, makeNonBinary, map, numLocations, oneNorm, plusEqualsSparse, plusEqualsSparse, print, setAll, setValue, setValueAtLocation, singleIndex, singleSize, singleToIndices, singleValue, timesEquals, timesEqualsSparse, timesEqualsSparse, timesEqualsSparseZero, twoNorm, value, value, valueAtLocation, vectorAdd
-
-
-
-
Method Detail
-
sortInstances
public static int[] sortInstances(InstanceList ilist, int[] instIndices, int featureIndex)
-
createGainRatio
public static GainRatio createGainRatio(InstanceList ilist)
Constructs a GainRatio object.
-
createGainRatio
public static GainRatio createGainRatio(InstanceList ilist, int[] instIndices, int minNumInsts)
Constructs a GainRatio object
-
getMaxValuedThreshold
public double getMaxValuedThreshold()
- Returns:
- the threshold of the (feature, threshold) pair with with maximum gain ratio
-
getThresholdAtRank
public double getThresholdAtRank(int rank)
- Returns:
- the threshold of the (feature, threshold) pair with the given rank
-
getBaseEntropy
public double getBaseEntropy()
-
getBaseLabelDistribution
public LabelVector getBaseLabelDistribution()
-
getNumSplitPointsForBestFeature
public int getNumSplitPointsForBestFeature()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG