Error: TypeError: generate_variants() takes 1 positional argument but 2 were given on 0.10.0
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 565
- Avg merge
- 5d 8m
- Merged PRs (30d)
- 17
Description
Hi,
I'm trying flaml on a new data set on a regression problem. I'm using version 0.10.0 . The following error also happens if I use classification. The dataset looks like this:
```csv
time , x, y, direction, congestion, hour, day_of_week, days_since_beg_of_time
1991-04-01 00:00:00, 0, 0, 'EB', 70, 0, 0, 0
```
The code is as simple as I can have it (I removed all the extra params). The error also happens if I limit to a specific estimator:
```python
from flaml import AutoML
automl = AutoML()
automl.fit(X,y, task="regression")
```
And the stack trace is:
```
[flaml.automl: 03-21 22:39:26] {2068} INFO - task = regression
[flaml.automl: 03-21 22:39:26] {2070} INFO - Data split method: uniform
[flaml.automl: 03-21 22:39:26] {2074} INFO - Evaluation method: holdout
[flaml.automl: 03-21 22:39:26] {2155} INFO - Minimizing error metric: 1-r2
[flaml.automl: 03-21 22:39:26] {2248} INFO - List of ML learners in AutoML Run: ['lgbm', 'rf', 'catboost', 'xgboost', 'extra_tree', 'xgb_limitdepth']
[flaml.automl: 03-21 22:39:26] {2501} INFO - iteration 0, current learner lgbm
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/tune/space.py in generate_variants_compatible(unresolved_spec, constant_grid_search, random_state)
20 try:
---> 21 return generate_variants(unresolved_spec, constant_grid_search, random_state)
22 except TypeError:
TypeError: generate_variants() takes 1 positional argument but 3 were given
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
in
3 automl = AutoML()
4
----> 5 automl.fit(X,y, task="regression") #, metric="mse", use_ray=False)
6
7
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/automl.py in fit(self, X_train, y_train, dataframe, label, metric, task, n_jobs, log_file_name, estimator_list, time_budget, max_iter, sample, ensemble, eval_method, log_type, model_history, split_ratio, n_splits, log_training_metric, mem_thres, pred_time_limit, train_time_limit, X_val, y_val, sample_weight_val, groups_val, groups, verbose, retrain_full, split_type, learner_selector, hpo_method, starting_points, seed, n_concurrent_trials, keep_search_state, early_stop, append_log, auto_augment, min_sample_size, use_ray, **fit_kwargs)
2273 else:
2274 self._training_log = None
-> 2275 self._search()
2276 if self._best_estimator:
2277 logger.info("fit succeeded")
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/automl.py in _search(self)
2769 )
2770 elif not self._use_ray:
-> 2771 self._search_sequential()
2772 else:
2773 self._search_parallel()
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/automl.py in _search_sequential(self)
2592 time_budget_s=min(budget_left, self._state.train_time_limit),
2593 verbose=max(self.verbose - 3, 0),
-> 2594 use_ray=False,
2595 )
2596 time_used = time.time() - start_run_time
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/tune/tune.py in run(evaluation_function, config, low_cost_partial_config, cat_hp_cost, metric, mode, time_budget_s, points_to_evaluate, evaluated_rewards, resource_attr, min_resource, max_resource, reduction_factor, scheduler, search_alg, verbose, local_dir, num_samples, resources_per_trial, config_constraints, metric_constraints, max_failure, use_ray, use_incumbent_result_in_evaluation)
445 and fail < ub
446 ):
--> 447 trial_to_run = _runner.step()
448 if trial_to_run:
449 num_trials += 1
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/tune/trial_runner.py in step(self)
117 """
118 trial_id = Trial.generate_id()
--> 119 config = self._search_alg.suggest(trial_id)
120 if config is not None:
121 trial = SimpleTrial(config, trial_id)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/ray/tune/suggest/suggestion.py in suggest(self, trial_id)
337 return
338
--> 339 suggestion = self.searcher.suggest(trial_id)
340 if suggestion not in (None, Searcher.FINISHED):
341 self.live_trials.add(trial_id)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/searcher/blendsearch.py in suggest(self, trial_id)
1000 # Need to restart
1001 self._init_used = False
-> 1002 return super().suggest(trial_id)
1003
1004 def _select_thread(self) -> Tuple:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/searcher/blendsearch.py in suggest(self, trial_id)
707 init_config = self._ls.init_config
708 config, space = self._ls.complete_config(
--> 709 init_config, self._ls_bound_min, self._ls_bound_max
710 )
711 if reward is None:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/searcher/flow2.py in complete_config(self, partial_config, lower, upper)
241 # if not the first time to complete init_config, use random gaussian
242 config, space = complete_config(
--> 243 partial_config, self.space, self, disturb, lower, upper
244 )
245 if partial_config == self.init_config:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/tune/space.py in complete_config(partial_config, space, flow2, disturb, lower, upper)
518 config[key] = value
519 for _, generated in generate_variants_compatible(
--> 520 {"config": config}, random_state=flow2.rs_random
521 ):
522 config = generated["config"]
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/flaml/tune/space.py in generate_variants_compatible(unresolved_spec, constant_grid_search, random_state)
21 return generate_variants(unresolved_spec, constant_grid_search, random_state)
22 except TypeError:
---> 23 return generate_variants(unresolved_spec, constant_grid_search)
24
25
TypeError: generate_variants() takes 1 positional argument but 2 were given
```
Any ideas? I've used FLAML succesfully in the past (older versions I can't go back to), but now I can't run a simpe fit.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.