FLAML
FLAML copied to clipboard
BlendSearch in UDF mode
When I select the BlendSearch search algorithm, I consistently encounter the following warning, whereas it does not appear when using CFO:
You passed a space
parameter to OptunaSearch that contained unresolved search space definitions. OptunaSearch should however be instantiated with fully configured search spaces only. To use Ray Tune's automatic search space conversion, pass the space definition as part of the param_space
argument to tune.Tuner()
instead.
Union[ Dict[str, "OptunaDistribution"], List[Tuple], Callable[["OptunaTrial"], Optional[Dict[str, Any]]], ]
The above is the space
parameter structure that is expected could you check with what you pass to BlendSearch?
and if possible send it...?
I got the same warning. I used the code in this example https://github.com/microsoft/FLAML/blob/main/test/tune_example.py
I belive that Passing the space definition as part of the param_space
argument to tune.Tuner()
when using BlendSearch with OptunaSearch in UDF mode should resolve this issue...
Sorry, But what argument are you referring to? I can not find anything about tune.Tuner()
in the doc.
Is it in this doc?
https://microsoft.github.io/FLAML/docs/reference/tune/tune
Do you have any code example? Thanks
Hi, I was thinking of something similar to the following code segment:
from flaml.tune import tune
# Define the parameter space for tuning
param_space = {
"n_estimators": tune.randint(lower=4, upper=1024),
"num_leaves": tune.randint(lower=4, upper=1024),
"min_child_samples": tune.randint(lower=2, upper=100),
}
# Define the settings for the AutoML run
settings = {
...,
"config": param_space,
}
# Run the AutoML search
automl.fit(X_train=X_train, y_train=y_train, **settings)```
Hmm...
I got the warning from this example: https://github.com/microsoft/FLAML/blob/main/test/tune_example.py
It does not use automl.fit
but tune.run()
for a user-defined function. But looking at your code, I see it's the same thing.
The dictionary setting
should work the same as this line.
analysis = tune.run(
train_lgbm,
metric="mse",
mode="min",
config=config_search_space,
low_cost_partial_config=low_cost_partial_config,
points_to_evaluate=points_to_evaluate,
time_budget_s=3,
num_samples=-1,
)
And that is where I got warning. Set search_alg = "CFO"
as make waning gone though.