microsoft / microsoft/FLAML

Preserve zero-valued anonymous tuning metrics

Open Beginner friendly
#1,602 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
4.4k
Forks
565
Avg merge
5d 8m
Merged PRs (30d)
17

Description

Returning 0 from an objective, or calling tune.report(0), drops the anonymous metric because report tests its truthiness. The default optimizer then raises KeyError: _metric instead of accepting the valid zero loss.

```python
from flaml import tune
tune.run(lambda config: 0.0, config={}, mode="min",
num_samples=1, use_ray=False, verbose=0)
```

Reproduced on Linux / Python 3.12 against main `f9e087c166f2e3feeb1e4b1f57fdd2a53df3ceac`, without Ray. A regression and focused fix are prepared.

This report was prepared with AI assistance.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the tune.run example in the issue and trace how the anonymous objective result reaches tune.report and the default optimizer. Verify that an objective returning 0.0 or tune.report(0) no longer causes KeyError: _metric, and confirm the existing nonzero behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.