Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add model saving for qrun and workflow example #264

Merged
merged 1 commit into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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