From fd04debcc6f70355f061f04d3e0f3fa79587015b Mon Sep 17 00:00:00 2001 From: IsaacMtz19 Date: Sat, 15 Nov 2025 23:18:52 -0600 Subject: [PATCH 1/2] fix: standardize the p-value values --- Murray/main.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Murray/main.py b/Murray/main.py index 8c6bf0d..5622a99 100644 --- a/Murray/main.py +++ b/Murray/main.py @@ -86,10 +86,10 @@ def select_treatments(similarity_matrix, treatment_size, excluded_locations): max_combinations = comb(n, r) n_combinations = max_combinations - if n_combinations > 5000: - n_combinations = 5000 - # if n_combinations > 2000: - # n_combinations = 2000 + # if n_combinations > 5000: + # n_combinations = 5000 + if n_combinations > 2000: + n_combinations = 2000 logger.debug(f"Generating {n_combinations} combinations") @@ -829,10 +829,10 @@ def BetterGroups( """ unique_locations = data["location"].unique() no_locations = len(unique_locations) - # max_group_size = round(no_locations * 0.35) - # min_elements_in_treatment = round(no_locations * 0.20) - max_group_size = round(no_locations * 0.45) - min_elements_in_treatment = round(no_locations * 0.15) + max_group_size = round(no_locations * 0.35) + min_elements_in_treatment = round(no_locations * 0.20) + # max_group_size = round(no_locations * 0.45) + # min_elements_in_treatment = round(no_locations * 0.15) min_holdout = 100 - (maximum_treatment_percentage * 100) total_Y = data["Y"].sum() @@ -1947,6 +1947,10 @@ def evaluate_sensitivity( mde_power = power break + # Standardize p-value: if < 0.001, set to 0.001 + if mde_p_value is not None and mde_p_value < 0.001: + mde_p_value = 0.001 + # Format values safely for logging p_value_str = f"{mde_p_value:.4f}" if mde_p_value is not None else "None" power_str = f"{mde_power:.4f}" if mde_power is not None else "None" From 30d6cb8acf8c7c90921f3b622899e4ee99a190d7 Mon Sep 17 00:00:00 2001 From: IsaacMtz19 Date: Sat, 15 Nov 2025 23:19:45 -0600 Subject: [PATCH 2/2] fix: return parameters --- Murray/main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Murray/main.py b/Murray/main.py index 5622a99..befb3aa 100644 --- a/Murray/main.py +++ b/Murray/main.py @@ -86,10 +86,10 @@ def select_treatments(similarity_matrix, treatment_size, excluded_locations): max_combinations = comb(n, r) n_combinations = max_combinations - # if n_combinations > 5000: - # n_combinations = 5000 - if n_combinations > 2000: - n_combinations = 2000 + if n_combinations > 5000: + n_combinations = 5000 + # if n_combinations > 2000: + # n_combinations = 2000 logger.debug(f"Generating {n_combinations} combinations") @@ -829,10 +829,10 @@ def BetterGroups( """ unique_locations = data["location"].unique() no_locations = len(unique_locations) - max_group_size = round(no_locations * 0.35) - min_elements_in_treatment = round(no_locations * 0.20) - # max_group_size = round(no_locations * 0.45) - # min_elements_in_treatment = round(no_locations * 0.15) + # max_group_size = round(no_locations * 0.35) + # min_elements_in_treatment = round(no_locations * 0.20) + max_group_size = round(no_locations * 0.45) + min_elements_in_treatment = round(no_locations * 0.15) min_holdout = 100 - (maximum_treatment_percentage * 100) total_Y = data["Y"].sum()