Skip to content

examples/workflow_by_code.ipynd: fix an error in R.get_recorder() par…#481

Merged
you-n-g merged 1 commit intomicrosoft:mainfrom
ai4stocks:working_workflow_fix_ipynb
Jun 26, 2021
Merged

examples/workflow_by_code.ipynd: fix an error in R.get_recorder() par…#481
you-n-g merged 1 commit intomicrosoft:mainfrom
ai4stocks:working_workflow_fix_ipynb

Conversation

@docularxu
Copy link
Contributor

@docularxu docularxu commented Jun 26, 2021

…ameters

get_recorder() needs specify 'recorder_id='. However workflow_by_code.ipynd
didn't. This patch fixes it.

Without this fix, here is the error message jupyter-notebook reports:

"---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

in
26 # backtest and analysis
27 with R.start(experiment_name="backtest_analysis"):
---> 28 recorder = R.get_recorder(rid, experiment_name="train_model")
29 model = recorder.load_object("trained_model")
30

TypeError: get_recorder() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given"

Signed-off-by: Guodong Xu guodong.xu@linaro.org

Description

Motivation and Context

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

…ameters

get_recorder() needs specify 'recorder_id='. However workflow_by_code.ipynd
didn't. This patch fixes it.

Without this fix, here is the error message jupyter-notebook reports:

"---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

<ipython-input-7-e6a7b5f4da00> in <module>
26 # backtest and analysis
27 with R.start(experiment_name="backtest_analysis"):
---> 28 recorder = R.get_recorder(rid, experiment_name="train_model")
29 model = recorder.load_object("trained_model")
30

TypeError: get_recorder() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given"

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
@you-n-g
Copy link
Collaborator

you-n-g commented Jun 26, 2021

@docularxu Hi, thanks so much! It's great!

@you-n-g you-n-g merged commit 8709dde into microsoft:main Jun 26, 2021
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
…ipynb

examples/workflow_by_code.ipynd: fix an error in R.get_recorder() par…
you-n-g pushed a commit to you-n-g/qlib that referenced this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants