Skip to content

Commit

Permalink
1-x is the same as (x-1)*(-1)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcjaeger committed Jun 2, 2024
1 parent b2c5d11 commit d5c1158
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/TreeClassification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@
case SPLIT_GINI: {

vec y_i = y_node.unsafe_col(y_col_split);
result = compute_gini(y_i, w_node, g_node);

// gini index: lower is better, so
// transform to make consistent with other stats
result = (result-1) * -1;
result = 1 - compute_gini(y_i, w_node, g_node);

break;
}
Expand Down

0 comments on commit d5c1158

Please sign in to comment.