mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-12 15:26:54 +08:00
Update CI
This commit is contained in:
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@@ -27,6 +27,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install --upgrade cython
|
pip install --upgrade cython
|
||||||
pip install numpy jupyter jupyter_contrib_nbextensions
|
pip install numpy jupyter jupyter_contrib_nbextensions
|
||||||
|
pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
|
||||||
python setup.py install
|
python setup.py install
|
||||||
|
|
||||||
- name: Install Lightgbm for MacOS
|
- name: Install Lightgbm for MacOS
|
||||||
|
|||||||
@@ -171,9 +171,9 @@ def get_all_results(folders) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
# function to generate and save markdown table
|
# function to generate and save markdown table
|
||||||
def gen_and_save_md_table(metrics):
|
def gen_and_save_md_table(metrics, dataset):
|
||||||
table = "| Model Name | Annualized Return | Information Ratio | Max Drawdown | IC | ICIR | Rank IC | Rank ICIR |\n"
|
table = "| Model Name | Dataset | Annualized Return | Information Ratio | Max Drawdown | IC | ICIR | Rank IC | Rank ICIR |\n"
|
||||||
table += "|---|---|---|---|---|---|---|---|\n"
|
table += "|---|---|---|---|---|---|---|---|---|\n"
|
||||||
for fn in metrics:
|
for fn in metrics:
|
||||||
ar = metrics[fn]["annualized_return_with_cost"]
|
ar = metrics[fn]["annualized_return_with_cost"]
|
||||||
ir = metrics[fn]["information_ratio_with_cost"]
|
ir = metrics[fn]["information_ratio_with_cost"]
|
||||||
@@ -182,7 +182,7 @@ def gen_and_save_md_table(metrics):
|
|||||||
icir = metrics[fn]["icir"]
|
icir = metrics[fn]["icir"]
|
||||||
ric = metrics[fn]["rank_ic"]
|
ric = metrics[fn]["rank_ic"]
|
||||||
ricir = metrics[fn]["rank_icir"]
|
ricir = metrics[fn]["rank_icir"]
|
||||||
table += f"| {fn} | {ar[0]:5.4f}±{ar[1]:2.2f} | {ir[0]:5.4f}±{ir[1]:2.2f}| {md[0]:5.4f}±{md[1]:2.2f} | {ic[0]:5.4f}±{ic[1]:2.2f} | {icir[0]:5.4f}±{icir[1]:2.2f}| {ric[0]:5.4f}±{ric[1]:2.2f} | {ricir[0]:5.4f}±{ricir[1]:2.2f} |\n"
|
table += f"| {fn} | {dataset} | {ar[0]:5.4f}±{ar[1]:2.2f} | {ir[0]:5.4f}±{ir[1]:2.2f}| {md[0]:5.4f}±{md[1]:2.2f} | {ic[0]:5.4f}±{ic[1]:2.2f} | {icir[0]:5.4f}±{icir[1]:2.2f}| {ric[0]:5.4f}±{ric[1]:2.2f} | {ricir[0]:5.4f}±{ricir[1]:2.2f} |\n"
|
||||||
pprint(table)
|
pprint(table)
|
||||||
with open("table.md", "w") as f:
|
with open("table.md", "w") as f:
|
||||||
f.write(table)
|
f.write(table)
|
||||||
@@ -289,7 +289,7 @@ def run(times=1, models=None, dataset="Alpha360", exclude=False):
|
|||||||
results = cal_mean_std(results)
|
results = cal_mean_std(results)
|
||||||
# generating md table
|
# generating md table
|
||||||
sys.stderr.write(f"Generating markdown table...\n")
|
sys.stderr.write(f"Generating markdown table...\n")
|
||||||
gen_and_save_md_table(results)
|
gen_and_save_md_table(results, dataset)
|
||||||
sys.stderr.write("\n")
|
sys.stderr.write("\n")
|
||||||
# print erros
|
# print erros
|
||||||
sys.stderr.write(f"Here are some of the errors of the models...\n")
|
sys.stderr.write(f"Here are some of the errors of the models...\n")
|
||||||
|
|||||||
7
setup.py
7
setup.py
@@ -94,12 +94,7 @@ setup(
|
|||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
python_requires=REQUIRES_PYTHON,
|
python_requires=REQUIRES_PYTHON,
|
||||||
packages=find_packages(
|
packages=find_packages(exclude=("tests",)),
|
||||||
exclude=(
|
|
||||||
"tests",
|
|
||||||
"examples",
|
|
||||||
)
|
|
||||||
),
|
|
||||||
# if your package is a single module, use this instead of 'packages':
|
# if your package is a single module, use this instead of 'packages':
|
||||||
# py_modules=['qlib'],
|
# py_modules=['qlib'],
|
||||||
entry_points={
|
entry_points={
|
||||||
|
|||||||
Reference in New Issue
Block a user