|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--shared.SplitScore
|
+--shared.SplitAttr
A class for determining, holding, and returning the information associated with an attribute split.
| Field Summary | |
static int |
multiRealThresholdSplit
SplitTypeEnum value. |
static int |
nominalSplit
SplitTypeEnum value. |
static int |
noReasonableSplit
SplitTypeEnum value. |
static int |
partitionSplit
SplitTypeEnum value. |
static int |
realThresholdSplit
SplitTypeEnum value. |
static java.lang.String[] |
splitTypeEnum
Names of SplitTypeEnum values. |
| Fields inherited from class shared.SplitScore |
defaultSplitScoreCriterion,
externalScore,
gainRatio,
logOptions,
mutualInfo,
mutualInfoRatio,
normalizedMutualInfo,
splitScoreCriterionEnum |
| Constructor Summary | |
SplitAttr()
Constructor. |
|
| Method Summary | |
void |
copy(SplitAttr original)
Copies the given SplitAttr inot this SplitAttr. |
boolean |
exist_split()
Returns TRUE if there is a split stored in this SplitAttr. |
void |
free_type_info()
Delete and clear typeInfo. |
int |
get_attr_num()
Returns the number of attributes. |
double |
get_gain_ratio(boolean penalize)
Returns the mutual gain-ratio. |
double |
get_mutual_info(boolean normalize,
boolean penalize)
Returns the mutual information. |
boolean |
get_penalize_by_mdl()
Returns the minimum distance length penalty value. |
void |
initialize(InstanceList[] instLists,
int attributeNumber)
Initialize attribute data and distribution arrays. |
boolean |
make_nominal_split()
Helper function to do all processing for nominals. |
boolean |
make_nominal_split(InstanceList instList,
int attributeNumber)
Helper function to do all processing for nominals. |
boolean |
make_real_split(RealAndLabelColumn column,
int attrNum,
double minSplit,
int smoothInst,
double smoothFactor)
Helper function to do all processing for real thresholds. |
static boolean |
ok_to_split(int attrNum,
BagCounters counters,
double minSplit)
Check if it is OK to make a split on the nominal attribute by making sure at least two branches have more than minSplit instances. |
double |
penalty()
Get penalty. |
void |
reset()
Reset values, except attribute number. |
void |
save_real_split(DoubleRef thresh,
IntRef splitIndex,
IntRef numDistinct)
The data calculated by find_best_threshold() is saved in the SplitAttr via this function. |
double |
score()
The criterion calculation depends on the score criterion. |
double |
score(double[][] sAndLDist,
double[] sDist,
double[] lDist)
Computes the scores and updates the cache when there are being computed many times for the same number of instances and entropy. |
double |
score(double[][] sAndLDist,
double[] sDist,
double[] lDist,
double entropy)
Computes the scores and updates the cache when there are being computed many times for the same number of instances and entropy. |
double |
score(double[][] sAndLDist,
double[] sDist,
double[] lDist,
double entropy,
double totalWeight)
Computes the scores and updates the cache when there are being computed many times for the same number of instances and entropy. |
void |
set_attr_num(int num)
Sets the attribute number for this split. |
void |
set_penalize_by_mdl(boolean choice)
Sets if the split should be penalized by minimum description length. |
int |
split_type()
Returns the type value of this SplitAttr. |
double |
threshold()
Return the threshold. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int noReasonableSplit
public static final int realThresholdSplit
public static final int multiRealThresholdSplit
public static final int nominalSplit
public static final int partitionSplit
public static java.lang.String[] splitTypeEnum
| Constructor Detail |
public SplitAttr()
| Method Detail |
public int split_type()
noReasonableSplit,
realThresholdSplit,
multiRealThresholdSplit,
nominalSplit,
partitionSplit
public double get_mutual_info(boolean normalize,
boolean penalize)
normalize - TRUE if the mutual info is to be normalized, FALSE otherwise.penalize - TRUE if the mutual info should be penalized, FALSE otherwise.public boolean exist_split()
public void set_penalize_by_mdl(boolean choice)
choice - TRUE if penalizing should occur, FALSE otherwise.
public boolean make_real_split(RealAndLabelColumn column,
int attrNum,
double minSplit,
int smoothInst,
double smoothFactor)
column - The column of real values for this attribute and their associated label values.attrNum - The number of the attribute.minSplit - The minimum split value.smoothInst - The instance to be smoothed towards.smoothFactor - The factor by which real values are smoothed.
public void save_real_split(DoubleRef thresh,
IntRef splitIndex,
IntRef numDistinct)
thresh - The threshold to be saved.splitIndex - The index of the split to be saved.numDistinct - The number of distinct splits.public void free_type_info()
public void reset()
public void set_attr_num(int num)
num - The number of the new attribute.
public boolean make_nominal_split(InstanceList instList,
int attributeNumber)
instList - The InstanceList over which to make a nominal split.attributeNumber - The number of the attribute to be split.public boolean make_nominal_split()
public static boolean ok_to_split(int attrNum,
BagCounters counters,
double minSplit)
attrNum - The number of the attribute to be checked.counters - Counters of the values for this attribute.minSplit - The minimum split value.public int get_attr_num()
public double penalty()
public boolean get_penalize_by_mdl()
public double get_gain_ratio(boolean penalize)
penalize - TRUE if penalization should occur, FALSE otherwise.public double threshold()
public void copy(SplitAttr original)
original - The SplitAttr to be copied.
public void initialize(InstanceList[] instLists,
int attributeNumber)
instLists - The InstanceList to use in initialization.attributeNumber - The number of the attribute.public double score()
public double score(double[][] sAndLDist,
double[] sDist,
double[] lDist,
double entropy,
double totalWeight)
sAndLDist - The split and label distribution.sDist - The split distribution.lDist - The label distribution.entropy - The entropy value.totalWeight - The total weight of instances.
public double score(double[][] sAndLDist,
double[] sDist,
double[] lDist,
double entropy)
sAndLDist - The split and label distribution.sDist - The split distribution.lDist - The label distribution.entropy - The entropy value.
public double score(double[][] sAndLDist,
double[] sDist,
double[] lDist)
sAndLDist - The split and label distribution.sDist - The split distribution.lDist - The label distribution.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||