Skip to content

Commit

Permalink
Removed usage of the FeatureMonotone function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Auguste committed Feb 20, 2020
1 parent 2f15206 commit c4a9ce8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/treelearner/monotone_constraints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ class LeafConstraints {
int parent_idx = learner_state.tree->node_parent(node_idx);
if (parent_idx != -1) {
int inner_feature = learner_state.tree->split_feature_inner(parent_idx);
int feature = learner_state.tree->split_feature(parent_idx);
int8_t monotone_type =
learner_state.train_data_->FeatureMonotone(inner_feature);
learner_state.config_->monotone_constraints[feature];
bool is_right_split =
learner_state.tree->right_child(parent_idx) == node_idx;
bool split_contains_new_information = true;
Expand Down
2 changes: 1 addition & 1 deletion src/treelearner/serial_tree_learner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ int32_t SerialTreeLearner::ForceSplits(Tree* tree, const Json& forced_split_json
// we want to know if the feature has to be monotone
bool feature_is_monotone = false;
if (!config_->monotone_constraints.empty()) {
feature_is_monotone = config_->monotone_constraints[inner_feature_index] != 0;
feature_is_monotone = config_->monotone_constraints[current_split_info.feature] != 0;
}
auto threshold_double = train_data_->RealThreshold(
inner_feature_index, current_split_info.threshold);
Expand Down

0 comments on commit c4a9ce8

Please sign in to comment.