Skip to content

Commit fbd8c6d

Browse files
authored
feat: Add description for scenario experiments. (microsoft#174)
* Fixed some bugs introduced during refactoring. * Add description for scenario experiments. * Update factor_from_report_w_sc.py * fix some ci bugs. * add @Property to get_experiment_setting * fix a ci error.
1 parent dcf9cd8 commit fbd8c6d

File tree

5 files changed

+49
-12
lines changed

5 files changed

+49
-12
lines changed

โ€Žrdagent/core/scenario.pyโ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ def rich_style_description(self) -> str:
3535
@abstractmethod
3636
def get_scenario_all_desc(self) -> str:
3737
"""Combine all the description together"""
38+
39+
@property
40+
@abstractmethod
41+
def get_experiment_setting(self) -> str:
42+
"""Get experiment setting and return as rich text string"""

โ€Žrdagent/log/ui/app.pyโ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,13 @@ def tasks_window(tasks: list[FactorTask | ModelTask]):
531531
st.header("Scenario Description๐Ÿ“–", divider="violet", anchor="_scenario")
532532
# TODO: other scenarios
533533
if state.log_type == "Qlib Model":
534-
st.markdown(QlibModelScenario().rich_style_description)
534+
st.markdown(QlibModelScenario().rich_style_description, unsafe_allow_html=True)
535535
elif state.log_type == "Data Mining":
536536
st.markdown(DMModelScenario().rich_style_description)
537537
elif state.log_type == "Qlib Factor":
538-
st.markdown(QlibFactorScenario().rich_style_description)
538+
st.markdown(QlibFactorScenario().rich_style_description, unsafe_allow_html=True)
539539
elif state.log_type == "Model from Paper":
540-
st.markdown(GeneralModelScenario().rich_style_description)
540+
st.markdown(GeneralModelScenario().rich_style_description, unsafe_allow_html=True)
541541

542542

543543
# Summary Window

โ€Žrdagent/scenarios/qlib/experiment/factor_experiment.pyโ€Ž

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def rich_style_description(self) -> str:
6262
#### [Objective](#_summary)
6363
6464
To demonstrate the dynamic evolution of financial factors through the Qlib platform, emphasizing how each iteration enhances the accuracy and reliability of the resulting financial factors.
65-
6665
"""
6766

6867
def get_scenario_all_desc(self) -> str:
@@ -77,3 +76,11 @@ def get_scenario_all_desc(self) -> str:
7776
The simulator user can use to test your factor:
7877
{self.simulator}
7978
"""
79+
80+
@property
81+
def get_experiment_setting(self) -> str:
82+
return """
83+
| Dataset ๐Ÿ“Š | Model ๐Ÿค– | Factors ๐ŸŒŸ | Data Split ๐Ÿงฎ |
84+
|---------|----------|---------------|-------------------------------------------------|
85+
| CSI300 | LGBModel | Alpha158 Plus | Train: 2008-01-01 to 2014-12-31 <br> Valid: 2015-01-01 to 2016-12-31 <br> Test &nbsp;: 2017-01-01 to 2020-08-01 |
86+
"""

โ€Žrdagent/scenarios/qlib/experiment/factor_from_report_experiment.pyโ€Ž

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class QlibFactorFromReportScenario(QlibFactorScenario):
1717
@property
1818
def rich_style_description(self) -> str:
1919
return """
20-
### R&D Agent-Qlib: Automated Quantitative Trading & Factors Extraction from Financial Reports Demo
20+
### R&D Agent-Qlib: Automated Quantitative Trading & Factor Extraction from Financial Reports Demo
21+
2122
2223
#### [Overview](#_summary)
2324
@@ -35,10 +36,26 @@ def rich_style_description(self) -> str:
3536
3637
#### [Objective](#_summary)
3738
38-
| Objective | Description |
39-
|-------------------|---------------------------------------------------------------------------------------------------------|
40-
| **Convenience** | Provide a tool for financial and quantitative practitioners or enthusiasts to quickly extract and test factors from research reports. |
41-
| **Efficiency** | Enable rapid identification of factors from a vast number of reports that could enhance the current factor library. |
42-
| **Research Facilitation** | Support further research by continuously expanding and refining the factor library. |
43-
| **Innovation** | Foster innovation in financial analysis by leveraging automated R&D processes to iterate and improve financial factors. |
39+
<table border="1" style="width:100%; border-collapse: collapse;">
40+
<tr>
41+
<td>๐Ÿ’ก <strong>Innovation </strong></td>
42+
<td>Tool to quickly extract and test factors from research reports.</td>
43+
</tr>
44+
<tr>
45+
<td>โšก <strong>Efficiency </strong></td>
46+
<td>Rapid identification of valuable factors from numerous reports.</td>
47+
</tr>
48+
<tr>
49+
<td>๐Ÿ—ƒ๏ธ <strong>Outputs </strong></td>
50+
<td>Expand and refine the factor library to support further research.</td>
51+
</tr>
52+
</table>
53+
"""
54+
55+
@property
56+
def get_experiment_setting(self) -> str:
57+
return """
58+
| Dataset ๐Ÿ“Š | Model ๐Ÿค– | Factors ๐ŸŒŸ | Data Split ๐Ÿงฎ |
59+
|---------|----------|---------------|-------------------------------------------------|
60+
| CSI300 | LGBModel | Alpha158 Plus | Train: 2008-01-01 to 2014-12-31 <br> Valid: 2015-01-01 to 2016-12-31 <br> Test &nbsp;: 2017-01-01 to 2020-08-01 |
4461
"""

โ€Žrdagent/scenarios/qlib/experiment/model_experiment.pyโ€Ž

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def rich_style_description(self) -> str:
6060
6161
#### [Objective](#_summary)
6262
63-
To demonstrate the dynamic evolution of models through the Qlib platform, emphasizing how each iteration enhances the accuracy and reliability of the resulting models. """
63+
To demonstrate the dynamic evolution of models through the Qlib platform, emphasizing how each iteration enhances the accuracy and reliability of the resulting models.
64+
"""
6465

6566
def get_scenario_all_desc(self) -> str:
6667
return f"""Background of the scenario:
@@ -72,3 +73,10 @@ def get_scenario_all_desc(self) -> str:
7273
The simulator user can use to test your model:
7374
{self.simulator}
7475
"""
76+
77+
def get_experiment_setting(self) -> str:
78+
return """
79+
| Dataset ๐Ÿ“Š | Model ๐Ÿค– | Factors ๐ŸŒŸ | Data Split ๐Ÿงฎ |
80+
|---------|----------|---------------|-------------------------------------------------|
81+
| CSI300 | RDAgent-dev | 20 factors (Alpha158) | Train: 2008-01-01 to 2014-12-31 <br> Valid: 2015-01-01 to 2016-12-31 <br> Test &nbsp;: 2017-01-01 to 2020-08-01 |
82+
"""

0 commit comments

Comments
ย (0)