Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
xjing76 committed Jul 13, 2020
1 parent af8d690 commit 0b99b8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/test_cmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,5 @@ def test_seasonality_cmp_sampling(N: int = 200, off_param=1):
check_metrics_for_sampling(trace_, simulation)
betas_np = np.concatenate([betas_intercept, betas_hour, betas_week])
beta_pred = trace_.posterior["beta_s"].values[0].mean(0)
assert np.allclose(beta_pred, betas_np)
beta_mape = abs(beta_pred - betas_np) / betas_np
assert beta_mape.mean() < 0.2
7 changes: 6 additions & 1 deletion tests/test_sampling_seasonality.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,9 @@ def test_seasonality_sampling(N: int = 200, off_param=1):
check_metrics_for_sampling(trace_, simulation)
betas_np = np.concatenate([betas_intercept, betas_hour, betas_week])
beta_pred = trace_.posterior["beta_s"].values[0].mean(0)
assert np.allclose(beta_pred, betas_np)
beta_mape = abs(beta_pred - betas_np) / betas_np
assert beta_mape.mean() < 0.1


#%%
test_seasonality_sampling()
3 changes: 2 additions & 1 deletion tests/test_ztp.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@ def test_seasonality_ztp_sampling(N: int = 200, off_param=1):
check_metrics_for_sampling(trace_, simulation)
betas_np = np.concatenate([betas_intercept, betas_hour, betas_week])
beta_pred = trace_.posterior["beta_s"].values[0].mean(0)
assert np.allclose(beta_pred, betas_np)
beta_mape = abs(beta_pred - betas_np) / betas_np
assert beta_mape.mean() < 0.1

0 comments on commit 0b99b8d

Please sign in to comment.