Commit 8ec8faa
Use compute_metric_availability in AxClient.fit_model (#5111)
Summary:
Pull Request resolved: #5111
The previous data check in `fit_model` only verified that the DataFrame
was non-empty (`lookup_data().df.empty`), which would pass even when data
existed for only a subset of required metrics. This could allow model
fitting to proceed with incomplete data, leading to downstream errors.
Replace the manual check with `compute_metric_availability()` from
`ax.core.utils`, which inspects per-trial metric coverage against the
optimization config's required metrics. `fit_model` now raises
`DataRequiredError` unless at least one completed trial has data for
**all** required metrics (`MetricAvailability.COMPLETE`).
Reviewed By: saitcakmak
Differential Revision: D98208718
fbshipit-source-id: 9c5b898a92e8656516e19af5a12174528e6ce9e41 parent 7c67537 commit 8ec8faa
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
1407 | 1408 | | |
1408 | 1409 | | |
1409 | 1410 | | |
1410 | | - | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1411 | 1416 | | |
1412 | | - | |
| 1417 | + | |
| 1418 | + | |
1413 | 1419 | | |
1414 | 1420 | | |
1415 | 1421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2581 | 2581 | | |
2582 | 2582 | | |
2583 | 2583 | | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
2584 | 2606 | | |
2585 | 2607 | | |
2586 | 2608 | | |
| |||
0 commit comments