From 99adc514a545b9fde8ea145334af6f32dc4e2427 Mon Sep 17 00:00:00 2001 From: Jactus Date: Fri, 4 Dec 2020 11:51:45 +0800 Subject: [PATCH] Update CI --- .github/workflows/test.yml | 1 + examples/run_all_model.py | 10 +++++----- setup.py | 7 +------ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 033d31536..9cc4d8cd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,7 @@ jobs: run: | pip install --upgrade cython 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 - name: Install Lightgbm for MacOS diff --git a/examples/run_all_model.py b/examples/run_all_model.py index 5223634b2..34651227c 100644 --- a/examples/run_all_model.py +++ b/examples/run_all_model.py @@ -171,9 +171,9 @@ def get_all_results(folders) -> dict: # function to generate and save markdown table -def gen_and_save_md_table(metrics): - table = "| Model Name | Annualized Return | Information Ratio | Max Drawdown | IC | ICIR | Rank IC | Rank ICIR |\n" - table += "|---|---|---|---|---|---|---|---|\n" +def gen_and_save_md_table(metrics, dataset): + table = "| Model Name | Dataset | Annualized Return | Information Ratio | Max Drawdown | IC | ICIR | Rank IC | Rank ICIR |\n" + table += "|---|---|---|---|---|---|---|---|---|\n" for fn in metrics: ar = metrics[fn]["annualized_return_with_cost"] ir = metrics[fn]["information_ratio_with_cost"] @@ -182,7 +182,7 @@ def gen_and_save_md_table(metrics): icir = metrics[fn]["icir"] ric = metrics[fn]["rank_ic"] 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) with open("table.md", "w") as f: f.write(table) @@ -289,7 +289,7 @@ def run(times=1, models=None, dataset="Alpha360", exclude=False): results = cal_mean_std(results) # generating md table 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") # print erros sys.stderr.write(f"Here are some of the errors of the models...\n") diff --git a/setup.py b/setup.py index 66d836444..cc495824e 100644 --- a/setup.py +++ b/setup.py @@ -94,12 +94,7 @@ setup( long_description=long_description, long_description_content_type="text/markdown", python_requires=REQUIRES_PYTHON, - packages=find_packages( - exclude=( - "tests", - "examples", - ) - ), + packages=find_packages(exclude=("tests",)), # if your package is a single module, use this instead of 'packages': # py_modules=['qlib'], entry_points={