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

zscore calculation was incorrect #201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions obp/dataset/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,9 @@ def _base_reward_function(
expected_rewards = context_values + action_values + context_action_values
if z_score:
expected_rewards = (
expected_rewards - expected_rewards.mean() / expected_rewards.std()
)

expected_rewards - expected_rewards.mean()
) / expected_rewards.std()
expected_rewards = degree * expected_rewards

return expected_rewards
Expand Down
2 changes: 1 addition & 1 deletion tests/ope/test_offline_estimation_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,5 @@ def process(i: int):
]
for estimator_name in tested_estimators:
assert (
relative_ee_df_mean[estimator_name] / relative_ee_df_mean["naive"] < 1.5
relative_ee_df_mean[estimator_name] / relative_ee_df_mean["naive"] < 1.65
), f"{estimator_name} is significantly worse than naive (on-policy) estimator"