Open liu100286 opened 3 years ago
Hi @liu100286 , thanks for the bug report. Have you tried this command: qcr.analysis_position.cumulative_return_graph(positions, report_normal_df, features_df)
. It seems that you are missing one of the folders in the path while calling the cumulative_return_graph
function.
Sorry for the misunderstanding in the documents. We will update the related docs soon.
ok,thanks. I see an example from the https://qlib.readthedocs.io/en/latest/reference/api.html?highlight=cumulative_return_graph.
🐛 Bug Description
To Reproduce
Steps to reproduce the behavior:
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
import sys from pathlib import Path
import qlib import pandas as pd from qlib.config import REG_CN from qlib.contrib.model.gbdt import LGBModel from qlib.contrib.data.handler import Alpha158 from qlib.contrib.strategy.strategy import TopkDropoutStrategy from qlib.contrib.evaluate import risk_analysis, backtest, long_short_backtest from qlib.contrib.evaluate import (backtest as normal_backtest,risk_analysis,) from qlib.utils import exists_qlib_data, init_instance_by_config, flatten_dict from qlib.workflow import R from qlib.workflow.record_temp import SignalRecord, PortAnaRecord from qlib.tests.data import GetData
if name == "main":
Execute the above code!!!
Expected Behavior
Screenshot
['analysis_position.report_graph', 'analysis_position.score_ic_graph', 'analysis_position.cumulative_return_graph', 'analysis_position.risk_analysis_graph', 'analysis_position.rank_label_graph', 'analysis_model.model_performance_graph'] [5151:MainThread](2021-04-19 12:38:55,455) ERROR - qlib.workflow - [utils.py:35] - An exception has been raised[AttributeError: module 'qlib.contrib.report' has no attribute 'cumulative_return_graph']. File "examples/workflow_by_code.py", line 171, in
qcr.cumulative_return_graph(positions, report_normal_df, features_df)
AttributeError: module 'qlib.contrib.report' has no attribute 'cumulative_return_graph'
Note: User could run
cd scripts && python collect_info.py all
under project directory to get system information and paste them here directly.Windows
,Linux
,MacOS
):linuxAdditional Notes