From cfc5e4fe8b2dddc2c3794267d461246ae8cddc35 Mon Sep 17 00:00:00 2001 From: shiyu1994 Date: Thu, 2 Jul 2020 13:09:10 +0800 Subject: [PATCH] store the true split gain in tree model (#3196) --- src/treelearner/serial_tree_learner.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/treelearner/serial_tree_learner.cpp b/src/treelearner/serial_tree_learner.cpp index db5cd0b4395d..97e0f91f9d9a 100644 --- a/src/treelearner/serial_tree_learner.cpp +++ b/src/treelearner/serial_tree_learner.cpp @@ -577,7 +577,8 @@ void SerialTreeLearner::SplitInner(Tree* tree, int best_leaf, int* left_leaf, static_cast(best_split_info.right_count), static_cast(best_split_info.left_sum_hessian), static_cast(best_split_info.right_sum_hessian), - static_cast(best_split_info.gain), + // store the true split gain in tree model + static_cast(best_split_info.gain + config_->min_gain_to_split), train_data_->FeatureBinMapper(inner_feature_index)->missing_type(), best_split_info.default_left); } else { @@ -613,7 +614,8 @@ void SerialTreeLearner::SplitInner(Tree* tree, int best_leaf, int* left_leaf, static_cast(best_split_info.right_count), static_cast(best_split_info.left_sum_hessian), static_cast(best_split_info.right_sum_hessian), - static_cast(best_split_info.gain), + // store the true split gain in tree model + static_cast(best_split_info.gain + config_->min_gain_to_split), train_data_->FeatureBinMapper(inner_feature_index)->missing_type()); }