From b7f5472f8045481703b1d96d2b8bf6d6ddc022b2 Mon Sep 17 00:00:00 2001 From: Mathieu Guillame-Bert Date: Wed, 11 Sep 2024 06:08:21 -0700 Subject: [PATCH] Improve error message when using the distributed gbt learner with a non supported task. PiperOrigin-RevId: 673362728 --- .../distributed_gradient_boosted_trees/worker.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/yggdrasil_decision_forests/learner/distributed_gradient_boosted_trees/worker.cc b/yggdrasil_decision_forests/learner/distributed_gradient_boosted_trees/worker.cc index 7d72010f..3d8d5f78 100644 --- a/yggdrasil_decision_forests/learner/distributed_gradient_boosted_trees/worker.cc +++ b/yggdrasil_decision_forests/learner/distributed_gradient_boosted_trees/worker.cc @@ -434,7 +434,12 @@ absl::Status DistributedGradientBoostedTreesWorker::GetLabelStatistics( answer->mutable_label_statistics(), thread_pool_.get())); } break; default: - return absl::InvalidArgumentError("Not supported task"); + return absl::InvalidArgumentError( + absl::StrCat("The distributed gradient boosted trees learner does " + "not support this task:", + model::proto::Task_Name(welcome_.train_config().task()), + ". Use the non-distributed " + "version of the learner.")); } return absl::OkStatus(); @@ -1267,7 +1272,12 @@ absl::StatusOr DistributedGradientBoostedTreesWorker::Loss( break; } default: - return absl::InvalidArgumentError("Not supported task"); + return absl::InvalidArgumentError( + absl::StrCat("The distributed gradient boosted trees learner does " + "not support this task:", + model::proto::Task_Name(welcome_.train_config().task()), + ". Use the non-distributed " + "version of the learner.")); } }