Skip to content

A programming framework for agentic AI

default to cfo for single estimator (#273)

Chi Wang62a31704eeb0
diff --git a/flaml/automl.py b/flaml/automl.py
index 825561445..010ea85f4 100644
--- a/flaml/automl.py
+++ b/flaml/automl.py
@@ -1592,7 +1592,13 @@ class AutoML:
self._n_concurrent_trials = n_concurrent_trials
self._early_stop = early_stop
self._use_ray = use_ray or n_concurrent_trials > 1
- self._hpo_method = hpo_method or ("bs" if self._use_ray else "cfo")
+ # use the following condition if we have an estimation of average_trial_time and average_trial_overhead
+ # self._use_ray = use_ray or n_concurrent_trials > ( average_trail_time + average_trial_overhead) / (average_trial_time)
+ self._hpo_method = hpo_method or (
+ "bs"
+ if n_concurrent_trials > 1 or self._use_ray and len(estimator_list) > 1
+ else "cfo"
+ )
if log_file_name:
with training_log_writer(log_file_name, append_log) as save_helper:
self._training_log = save_helper