public class GainRatio extends RankedFeatureVector
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
RankedFeatureVector.Factory, RankedFeatureVector.PerLabelFactory| Modifier and Type | Field and Description |
|---|---|
static double |
log2 |
hasInfinite, indices, values| Modifier | Constructor and Description |
|---|---|
protected |
GainRatio(Alphabet dataAlphabet,
double[] gainRatios,
double[] splitPoints,
double baseEntropy,
LabelVector baseLabelDistribution,
int numSplitPointsForBestFeature,
int minNumInsts) |
| Modifier and Type | Method and Description |
|---|---|
protected static Object[] |
calcGainRatios(InstanceList ilist,
int[] instIndices,
int minNumInsts)
Calculates gain ratios for all (feature, split point) pairs
snd returns array of:
|
static GainRatio |
createGainRatio(InstanceList ilist)
Constructs a GainRatio object.
|
static GainRatio |
createGainRatio(InstanceList ilist,
int[] instIndices,
int minNumInsts)
Constructs a GainRatio object
|
double |
getBaseEntropy() |
LabelVector |
getBaseLabelDistribution() |
double |
getMaxValuedThreshold() |
int |
getNumSplitPointsForBestFeature() |
double |
getThresholdAtRank(int rank) |
static int[] |
sortInstances(InstanceList ilist,
int[] instIndices,
int featureIndex) |
getIndexAtRank, getMaxValue, getMaxValuedIndex, getMaxValuedIndexIn, getMaxValuedObject, getMaxValuedObjectIn, getMaxValueIn, getObjectAtRank, getRank, getRank, getValueAtRank, printByRank, printByRank, set, setRankOrder, setRankOrder, setRankOrdercloneMatrix, cloneMatrixZeroed, contains, getAlphabet, getObjectIndices, location, toSimpFile, toString, toString, valueabsNorm, addTo, addTo, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, indexAtLocation, infinityNorm, isBinary, isNaN, location, makeBinary, makeNonBinary, map, numLocations, oneNorm, plusEqualsSparse, plusEqualsSparse, print, removeDuplicates, setAll, setValue, setValueAtLocation, singleIndex, singleSize, singleToIndices, singleValue, sortIndices, timesEquals, timesEqualsSparse, timesEqualsSparse, twoNorm, value, value, valueAtLocation, vectorAddprotected GainRatio(Alphabet dataAlphabet, double[] gainRatios, double[] splitPoints, double baseEntropy, LabelVector baseLabelDistribution, int numSplitPointsForBestFeature, int minNumInsts)
protected static Object[] calcGainRatios(InstanceList ilist, int[] instIndices, int minNumInsts)
1. gain ratios (each element is the max gain ratio of a feature for those split points with at least average gain) 2. the optimal split point for each feature 3. the overall entropy 4. the overall label distribution of the given instances 5. the number of split points of the split feature.
public static int[] sortInstances(InstanceList ilist, int[] instIndices, int featureIndex)
public static GainRatio createGainRatio(InstanceList ilist)
public static GainRatio createGainRatio(InstanceList ilist, int[] instIndices, int minNumInsts)
public double getMaxValuedThreshold()
public double getThresholdAtRank(int rank)
public double getBaseEntropy()
public LabelVector getBaseLabelDistribution()
public int getNumSplitPointsForBestFeature()
Copyright © 2019 JULIE Lab, Germany. All rights reserved.