Skip to content

Commit

Permalink
Add model saving for qrun and workflow example
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek-Wds authored and you-n-g committed Feb 7, 2021
1 parent 07b905c commit c948385
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/workflow_by_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
with R.start(experiment_name="workflow"):
R.log_params(**flatten_dict(task))
model.fit(dataset)
R.save_objects(**{"params.pkl": model})

# prediction
recorder = R.get_recorder()
Expand Down
1 change: 1 addition & 0 deletions qlib/model/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def task_train(task_config: dict, experiment_name):
R.log_params(**flatten_dict(task_config))
model.fit(dataset)
recorder = R.get_recorder()
R.save_objects(**{"params.pkl": model})

# generate records: prediction, backtest, and analysis
for record in task_config["record"]:
Expand Down

0 comments on commit c948385

Please sign in to comment.