Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
athawk81 committed Jun 17, 2015
1 parent c0eacea commit a9d7f7b
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -43,7 +43,7 @@ public final class TreeBuilder<T extends ClassifierInstance> implements Predicti
private static final int HARD_MINIMUM_INSTANCES_PER_CATEGORICAL_VALUE = 10;
public static final String MIN_SPLIT_FRACTION = "minSplitFraction";
public static final String EXEMPT_ATTRIBUTES = "exemptAttributes";
public static final String IMBALANCE_PENALTY_POWER = "impbalancePenaltyPower";
public static final String IMBALANCE_PENALTY_POWER = "imbalancePenaltyPower";

private Scorer scorer;
private int maxDepth = 5;
Expand Down Expand Up @@ -485,7 +485,7 @@ private Pair<? extends Branch, Double> createTwoClassCategoricalNode(Node parent
thisScore = thisScore * (1 - degreeOfGainRatioPenalty) + degreeOfGainRatioPenalty * (thisScore / intrinsicValueOfAttribute);
}
if (imbalancePenaltyPower!=0) {
thisScore/=Math.pow(Math.min(inCounts.getTotal(), outCounts.getTotal()), imbalancePenaltyPower);
thisScore/=Math.pow(Math.max(inCounts.getTotal(), outCounts.getTotal()), imbalancePenaltyPower);
}
if (thisScore > bestScore) {
bestScore = thisScore;
Expand Down

0 comments on commit a9d7f7b

Please sign in to comment.