mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 16:26:55 +08:00
Add model saving for qrun and workflow example
This commit is contained in:
@@ -112,6 +112,7 @@ if __name__ == "__main__":
|
|||||||
with R.start(experiment_name="workflow"):
|
with R.start(experiment_name="workflow"):
|
||||||
R.log_params(**flatten_dict(task))
|
R.log_params(**flatten_dict(task))
|
||||||
model.fit(dataset)
|
model.fit(dataset)
|
||||||
|
R.save_objects(**{"params.pkl": model})
|
||||||
|
|
||||||
# prediction
|
# prediction
|
||||||
recorder = R.get_recorder()
|
recorder = R.get_recorder()
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ def task_train(task_config: dict, experiment_name):
|
|||||||
R.log_params(**flatten_dict(task_config))
|
R.log_params(**flatten_dict(task_config))
|
||||||
model.fit(dataset)
|
model.fit(dataset)
|
||||||
recorder = R.get_recorder()
|
recorder = R.get_recorder()
|
||||||
|
R.save_objects(**{"params.pkl": model})
|
||||||
|
|
||||||
# generate records: prediction, backtest, and analysis
|
# generate records: prediction, backtest, and analysis
|
||||||
for record in task_config["record"]:
|
for record in task_config["record"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user