Skip to content

Commit

Permalink
clarify warning about small target values with MAPE (#3615)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Dec 11, 2020
1 parent 6320f1d commit 24298ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/objective/regression_objective.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,9 @@ class RegressionMAPELOSS : public RegressionL1loss {
RegressionL2loss::Init(metadata, num_data);
for (data_size_t i = 0; i < num_data_; ++i) {
if (std::fabs(label_[i]) < 1) {
Log::Warning("Met 'abs(label) < 1', will convert them to '1' in MAPE objective and metric");
Log::Warning(
"Some label values are < 1 in absolute value. MAPE is unstable with such values, "
"so LightGBM rounds them to 1.0 when calculating MAPE.");
break;
}
}
Expand Down

0 comments on commit 24298ed

Please sign in to comment.