Skip to content

Commit

Permalink
Pass cost_attr and cost_budget from flaml.tune.run() to the search al…
Browse files Browse the repository at this point in the history
…go it calls
  • Loading branch information
EgorKraevTransferwise committed Dec 2, 2024
1 parent b9194cd commit 969028f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flaml/tune/tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def run(
mlflow_exp_name: Optional[str] = None,
automl_info: Optional[Tuple[float]] = None,
extra_tag: Optional[dict] = None,
cost_attr: Optional[str] = "auto",
cost_budget: Optional[float] = None,
**ray_args,
):
"""The function-based way of performing HPO.
Expand Down Expand Up @@ -462,6 +464,8 @@ def easy_objective(config):
overwritten by the value of `n_concurrent_trials` in AutoML. When <= 0, the concurrent trials
will be set to the number of executors.
extra_tag: dict, default=None | Extra tags to be added to the mlflow runs created by autologging.
cost_attr: str, default="auto" | name of an alternative cost metric, passed through to the search algorithm
cost_budget: Optional[float], default=None | The budget for the cost metric, passed through to the search algorithm
**ray_args: keyword arguments to pass to ray.tune.run().
Only valid when use_ray=True.
"""
Expand Down Expand Up @@ -600,6 +604,8 @@ def easy_objective(config):
metric_constraints=metric_constraints,
use_incumbent_result_in_evaluation=use_incumbent_result_in_evaluation,
lexico_objectives=lexico_objectives,
cost_attr=cost_attr,
cost_budget=cost_budget,
)
else:
if metric is None or mode is None:
Expand Down

0 comments on commit 969028f

Please sign in to comment.