Skip to content

A programming framework for agentic AI

add best_loss_per_estimator

Qingyun Wue9551de3ccde
diff --git a/flaml/automl.py b/flaml/automl.py
index 9c002270f..3cf66b226 100644
--- a/flaml/automl.py
+++ b/flaml/automl.py
@@ -460,6 +460,14 @@ class AutoML:
for e, e_search_state in self._search_states.items()
}
+ @property
+ def best_loss_per_estimator(self):
+ """A dictionary of all estimators' best loss."""
+ return {
+ e: e_search_state.best_loss
+ for e, e_search_state in self._search_states.items()
+ }
+
@property
def best_loss(self):
"""A float of the best loss found."""
diff --git a/test/test_multiclass.py b/test/test_multiclass.py
index 4160e348f..096fc6288 100644
--- a/test/test_multiclass.py
+++ b/test/test_multiclass.py
@@ -412,6 +412,7 @@ class TestMultiClass(unittest.TestCase):
starting_points = automl_experiment.best_config_per_estimator
print("starting_points", starting_points)
+ print("loss of the starting_points", automl_experiment.best_loss_per_estimator)
automl_settings_resume = {
"time_budget": 2,
"metric": "accuracy",