From dd07c25d1227f7ebfe596d048be3b62c6fb97369 Mon Sep 17 00:00:00 2001 From: jqmp Date: Sun, 29 Jul 2018 22:08:14 -0400 Subject: [PATCH] Fix typo in ElasticNet threshold function (#3527) --- src/tree/split_evaluator.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tree/split_evaluator.cc b/src/tree/split_evaluator.cc index f30433b0d..dc9da278d 100644 --- a/src/tree/split_evaluator.cc +++ b/src/tree/split_evaluator.cc @@ -142,11 +142,12 @@ class ElasticNet final : public SplitEvaluator { inline double ThresholdL1(double g) const { if (g > params_.reg_alpha) { - g = g - params_.reg_alpha; + return g - params_.reg_alpha; } else if (g < -params_.reg_alpha) { - g = g + params_.reg_alpha; + return g + params_.reg_alpha; + } else { + return 0.0; } - return g; } };