Skip to content

Commit

Permalink
Merge pull request #19 from ivelin/fix/dashboard
Browse files Browse the repository at this point in the history
add and fix MALE formula in backtest error column
  • Loading branch information
ivelin authored Mar 2, 2024
2 parents 710fc66 + a71bd47 commit f9c0bf7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
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

0 comments on commit f9c0bf7

Please sign in to comment.