From 5930a5d2a7de114846d39ce0b26f87c7346ed86d Mon Sep 17 00:00:00 2001 From: John Zedlewski Date: Thu, 5 Mar 2020 15:34:19 -0800 Subject: [PATCH] Change max_depth condition --- cpp/src/decisiontree/levelalgo/levelhelper_classifier.cuh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/decisiontree/levelalgo/levelhelper_classifier.cuh b/cpp/src/decisiontree/levelalgo/levelhelper_classifier.cuh index a0855df0cd..4f0cde99f6 100644 --- a/cpp/src/decisiontree/levelalgo/levelhelper_classifier.cuh +++ b/cpp/src/decisiontree/levelalgo/levelhelper_classifier.cuh @@ -299,7 +299,8 @@ void leaf_eval_classification( int non_leaf_counter = 0; // XXX: This line fixes the inaccuracy in max_depth==1 tree leaf predictions // I still don't fully understand its role, but it seems interesting - bool condition_global = true; // XXX removed: (curr_depth == max_depth); + bool condition_global = + curr_depth >= max_depth - 1; // XXX removed: (curr_depth == max_depth); if (max_leaves != -1) condition_global = condition_global || (tree_leaf_cnt >= max_leaves);