mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-17 17:34:35 +08:00
update cli.py (#1008)
* update cli.py update cli.py so that one can specify exp_manager uri in "qlib_init" and "experiment_name" in *.yaml file. * black cli.py * Resolving pre-commit-hook changes
This commit is contained in:
@@ -54,10 +54,15 @@ def workflow(config_path, experiment_name="workflow", uri_folder="mlruns"):
|
|||||||
# config the `sys` section
|
# config the `sys` section
|
||||||
sys_config(config, config_path)
|
sys_config(config, config_path)
|
||||||
|
|
||||||
exp_manager = C["exp_manager"]
|
if "exp_manager" in config.get("qlib_init"):
|
||||||
exp_manager["kwargs"]["uri"] = "file:" + str(Path(os.getcwd()).resolve() / uri_folder)
|
qlib.init(**config.get("qlib_init"))
|
||||||
qlib.init(**config.get("qlib_init"), exp_manager=exp_manager)
|
else:
|
||||||
|
exp_manager = C["exp_manager"]
|
||||||
|
exp_manager["kwargs"]["uri"] = "file:" + str(Path(os.getcwd()).resolve() / uri_folder)
|
||||||
|
qlib.init(**config.get("qlib_init"), exp_manager=exp_manager)
|
||||||
|
|
||||||
|
if "experiment_name" in config:
|
||||||
|
experiment_name = config["experiment_name"]
|
||||||
recorder = task_train(config.get("task"), experiment_name=experiment_name)
|
recorder = task_train(config.get("task"), experiment_name=experiment_name)
|
||||||
recorder.save_objects(config=config)
|
recorder.save_objects(config=config)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user