Skip to content

Commit 2cc43eb

Browse files
committed
Add default model selection when no valid metrics are calculated
1 parent 4523a0d commit 2cc43eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ads/opctl/operator/lowcode/forecast/model_evaluator.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ def find_best_model(
233233
nonempty_metrics = {
234234
model: metric for model, metric in metrics.items() if metric != {}
235235
}
236+
if not nonempty_metrics:
237+
model = SupportedModels.Prophet
238+
logger.warning(
239+
f"No valid metrics calculated for any model. Defaulting to {model}."
240+
)
241+
return model
242+
236243
avg_backtests_metric = {
237244
model: sum(value.values()) / len(value.values())
238245
for model, value in nonempty_metrics.items()

0 commit comments

Comments
 (0)