Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add and fix MALE formula in backtest error column #19

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/workflows/pr_agent.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion src/canswim/dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def initdb(self):
duckdb.sql(
f"""
CREATE VIEW backtest_error
AS SELECT f.symbol, mean(log(1+abs(f."close_quantile_0.5"-cp.Close))) as mal_error
AS SELECT f.symbol, mean(abs(log(greatest(f."close_quantile_0.5", 0.01)/cp.Close))) as mal_error
FROM forecast as f, close_price as cp
WHERE cp.symbol = f.symbol AND cp.date = f.date
GROUP BY f.symbol, cp.symbol
Expand Down
2 changes: 1 addition & 1 deletion src/canswim/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def __prepare_data_splits(self):
self.past_cov_list.append(self.covariates.past_covariates[t])
self.future_cov_list.append(self.covariates.future_covariates[t])
self.__validate_train_data()
logger.info(f"Total # stocks in train list: {len(self.target_train_list)}")
if len(self.target_train_list) > 0:
logger.info(
f"Sample train series start time: {self.target_train_list[0].start_time()}, end time: {self.target_train_list[0].end_time()}"
Expand All @@ -285,6 +284,7 @@ def __prepare_data_splits(self):
f"Sample future covariates columns count: {len(self.future_cov_list[0].columns)}, {self.future_cov_list[0].columns}"
)
# update targets series dict
logger.info(f"Total # stocks in train list: {len(self.target_train_list)}")
updated_target_series = {}
for t in self.train_series.keys():
updated_target_series[t] = self.targets.target_series[t]
Expand Down