Skip to content

Commit

Permalink
feat: Add description for scenario experiments. (#174)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
WinstonLiyt authored Aug 6, 2024
1 parent dcf9cd8 commit fbd8c6d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 12 deletions.
5 changes: 5 additions & 0 deletions rdagent/core/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ def rich_style_description(self) -> str:
@abstractmethod
def get_scenario_all_desc(self) -> str:
"""Combine all the description together"""

@property
@abstractmethod
def get_experiment_setting(self) -> str:
"""Get experiment setting and return as rich text string"""
6 changes: 3 additions & 3 deletions rdagent/log/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,13 @@ def tasks_window(tasks: list[FactorTask | ModelTask]):
st.header("Scenario Description📖", divider="violet", anchor="_scenario")
# TODO: other scenarios
if state.log_type == "Qlib Model":
st.markdown(QlibModelScenario().rich_style_description)
st.markdown(QlibModelScenario().rich_style_description, unsafe_allow_html=True)
elif state.log_type == "Data Mining":
st.markdown(DMModelScenario().rich_style_description)
elif state.log_type == "Qlib Factor":
st.markdown(QlibFactorScenario().rich_style_description)
st.markdown(QlibFactorScenario().rich_style_description, unsafe_allow_html=True)
elif state.log_type == "Model from Paper":
st.markdown(GeneralModelScenario().rich_style_description)
st.markdown(GeneralModelScenario().rich_style_description, unsafe_allow_html=True)


# Summary Window
Expand Down
9 changes: 8 additions & 1 deletion rdagent/scenarios/qlib/experiment/factor_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def rich_style_description(self) -> str:
#### [Objective](#_summary)
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.
"""

def get_scenario_all_desc(self) -> str:
Expand All @@ -77,3 +76,11 @@ def get_scenario_all_desc(self) -> str:
The simulator user can use to test your factor:
{self.simulator}
"""

@property
def get_experiment_setting(self) -> str:
return """
| Dataset 📊 | Model 🤖 | Factors 🌟 | Data Split 🧮 |
|---------|----------|---------------|-------------------------------------------------|
| 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 |
"""
31 changes: 24 additions & 7 deletions rdagent/scenarios/qlib/experiment/factor_from_report_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class QlibFactorFromReportScenario(QlibFactorScenario):
@property
def rich_style_description(self) -> str:
return """
### R&D Agent-Qlib: Automated Quantitative Trading & Factors Extraction from Financial Reports Demo
### R&D Agent-Qlib: Automated Quantitative Trading & Factor Extraction from Financial Reports Demo
#### [Overview](#_summary)
Expand All @@ -35,10 +36,26 @@ def rich_style_description(self) -> str:
#### [Objective](#_summary)
| Objective | Description |
|-------------------|---------------------------------------------------------------------------------------------------------|
| **Convenience** | Provide a tool for financial and quantitative practitioners or enthusiasts to quickly extract and test factors from research reports. |
| **Efficiency** | Enable rapid identification of factors from a vast number of reports that could enhance the current factor library. |
| **Research Facilitation** | Support further research by continuously expanding and refining the factor library. |
| **Innovation** | Foster innovation in financial analysis by leveraging automated R&D processes to iterate and improve financial factors. |
<table border="1" style="width:100%; border-collapse: collapse;">
<tr>
<td>💡 <strong>Innovation </strong></td>
<td>Tool to quickly extract and test factors from research reports.</td>
</tr>
<tr>
<td>⚡ <strong>Efficiency </strong></td>
<td>Rapid identification of valuable factors from numerous reports.</td>
</tr>
<tr>
<td>🗃️ <strong>Outputs </strong></td>
<td>Expand and refine the factor library to support further research.</td>
</tr>
</table>
"""

@property
def get_experiment_setting(self) -> str:
return """
| Dataset 📊 | Model 🤖 | Factors 🌟 | Data Split 🧮 |
|---------|----------|---------------|-------------------------------------------------|
| 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 |
"""
10 changes: 9 additions & 1 deletion rdagent/scenarios/qlib/experiment/model_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def rich_style_description(self) -> str:
#### [Objective](#_summary)
To demonstrate the dynamic evolution of models through the Qlib platform, emphasizing how each iteration enhances the accuracy and reliability of the resulting models. """
To demonstrate the dynamic evolution of models through the Qlib platform, emphasizing how each iteration enhances the accuracy and reliability of the resulting models.
"""

def get_scenario_all_desc(self) -> str:
return f"""Background of the scenario:
Expand All @@ -72,3 +73,10 @@ def get_scenario_all_desc(self) -> str:
The simulator user can use to test your model:
{self.simulator}
"""

def get_experiment_setting(self) -> str:
return """
| Dataset 📊 | Model 🤖 | Factors 🌟 | Data Split 🧮 |
|---------|----------|---------------|-------------------------------------------------|
| 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 |
"""

0 comments on commit fbd8c6d

Please sign in to comment.