microsoft / microsoft/FLAML

Unable to run code

Open
#1,132 11 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Jupyter Notebook
Stars
4.4k
Forks
565
Avg merge
5d 8m
Merged PRs (30d)
17

Description

automl.fit(X_train, y_train, task="regression",metric='rmse',time_budget=3600)
[flaml.automl.logger: 07-17 14:34:05] {1693} INFO - task = regression
[flaml.automl.logger: 07-17 14:34:05] {1700} INFO - Data split method: uniform
[flaml.automl.logger: 07-17 14:34:05] {1703} INFO - Evaluation method: holdout
[flaml.automl.logger: 07-17 14:34:05] {1801} INFO - Minimizing error metric: rmse
[flaml.automl.logger: 07-17 14:34:06] {1911} INFO - List of ML learners in AutoML Run: ['lgbm', 'rf', 'catboost', 'xgboost', 'extra_tree', 'xgb_limitdepth']
[flaml.automl.logger: 07-17 14:34:06] {2221} INFO - iteration 0, current learner lgbm

AttributeError Traceback (most recent call last)
Cell In[36], line 1
----> 1 automl.fit(X_train, y_train, task="regression",metric='rmse',time_budget=3600)

File /opt/conda/lib/python3.10/site-packages/flaml/automl/automl.py:1939, in AutoML.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, preserve_checkpoint, early_stop, force_cancel, append_log, auto_augment, min_sample_size, use_ray, use_spark, free_mem_ratio, metric_constraints, custom_hp, cv_score_agg_func, skip_transform, mlflow_logging, fit_kwargs_by_estimator, **fit_kwargs)
1937 else:
1938 self._training_log = None
-> 1939 self._search()
1940 if self._best_estimator:
1941 logger.info("fit succeeded")

File /opt/conda/lib/python3.10/site-packages/flaml/automl/automl.py:2485, in AutoML._search(self)
2483 state.best_config = state.init_config[0] if state.init_config else {}
2484 elif self._use_ray is False and self._use_spark is False:
-> 2485 self._search_sequential()
2486 else:
2487 self._search_parallel()

File /opt/conda/lib/python3.10/site-packages/flaml/automl/automl.py:2321, in AutoML._search_sequential(self)
2315 search_state.search_alg.searcher.set_search_properties(
2316 metric=None,
2317 mode=None,
2318 metric_target=self._state.best_loss,
2319 )
2320 start_run_time = time.time()
-> 2321 analysis = tune.run(
2322 search_state.training_function,
2323 search_alg=search_state.search_alg,
2324 time_budget_s=time_budget_s,
2325 verbose=max(self.verbose - 3, 0),
2326 use_ray=False,
2327 use_spark=False,
2328 )
2329 time_used = time.time() - start_run_time
2330 better = False

File /opt/conda/lib/python3.10/site-packages/flaml/tune/tune.py:797, 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_spark, use_incumbent_result_in_evaluation, log_file_name, lexico_objectives, force_cancel, n_concurrent_trials, **ray_args)
795 if num_failures == upperbound_num_failures:
796 logger.warning(f"fail to sample a trial for {max_failure} times in a row, stopping.")
--> 797 analysis = ExperimentAnalysis(
798 _runner.get_trials(),
799 metric=metric,
800 mode=mode,
801 lexico_objectives=lexico_objectives,
802 )
803 return analysis
804 finally:
805 # recover the global variables in case of nested run

File /opt/conda/lib/python3.10/site-packages/flaml/tune/tune.py:45, in ExperimentAnalysis.__init__(self, trials, metric, mode, lexico_objectives)
43 def __init__(self, trials, metric, mode, lexico_objectives=None):
44 try:
---> 45 super().__init__(self, None, trials, metric, mode)
46 self.lexico_objectives = lexico_objectives
47 except (TypeError, ValueError):

File /opt/conda/lib/python3.10/site-packages/ray/tune/analysis/experiment_analysis.py:97, in ExperimentAnalysis.__init__(self, experiment_checkpoint_path, trials, default_metric, default_mode, remote_storage_path, sync_config)
92 self._remote_experiment_path: Optional[str] = None
94 # If the user passes in a remote checkpoint path,
95 # Set the remote experiment path to this path, and set
96 # the local experiment path to a temp directory.
---> 97 if not is_local_path(experiment_checkpoint_path):
98 self._remote_experiment_path = experiment_checkpoint_path
100 # Create a temp directory to store downloaded checkpoint files if
101 # they are pulled from a remote `experiment_checkpoint_path`.

File /opt/conda/lib/python3.10/site-packages/ray/air/_internal/remote_storage.py:167, in is_local_path(path)
164 if sys.platform == "win32":
165 return _is_local_windows_path(path)
--> 167 scheme = urllib.parse.urlparse(path).scheme
168 return scheme in ("", "file")

File /opt/conda/lib/python3.10/urllib/parse.py:399, in urlparse(url, scheme, allow_fragments)
379 def urlparse(url, scheme='', allow_fragments=True):
380 """Parse a URL into 6 components:
381 :///;?#
382
(...)
397 Note that % escapes are not expanded.
398 """
--> 399 url, scheme, _coerce_result = _coerce_args(url, scheme)
400 splitresult = urlsplit(url, scheme, allow_fragments)
401 scheme, netloc, url, query, fragment = splitresult

File /opt/conda/lib/python3.10/urllib/parse.py:136, in _coerce_args(*args)
134 if str_input:
135 return args + (_noop,)
--> 136 return _decode_args(args) + (_encode_result,)

File /opt/conda/lib/python3.10/urllib/parse.py:120, in _decode_args(args, encoding, errors)
118 def _decode_args(args, encoding=_implicit_encoding,
119 errors=_implicit_errors):
--> 120 return tuple(x.decode(encoding, errors) if x else '' for x in args)

File /opt/conda/lib/python3.10/urllib/parse.py:120, in (.0)
118 def _decode_args(args, encoding=_implicit_encoding,
119 errors=_implicit_errors):
--> 120 return tuple(x.decode(encoding, errors) if x else '' for x in args)

AttributeError: 'ExperimentAnalysis' object has no attribute 'decode'

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.