diff --git a/abexp/core/planning.py b/abexp/core/planning.py index f59df89..28cbc82 100644 --- a/abexp/core/planning.py +++ b/abexp/core/planning.py @@ -1,17 +1,17 @@ # MIT License -# +# # Copyright (c) 2021 Playtika Ltd. -# +# # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -26,9 +26,10 @@ class Planning: - @staticmethod - def planning_diff_mean(avg_n_users_per_day, mean_contr, mean_treat, std_contr, alpha=0.05, power=0.8): + def planning_diff_mean( + avg_n_users_per_day, mean_contr, mean_treat, std_contr, alpha=0.05, power=0.8 + ): """ Use the sample size determination with means comparison from the core.design.SampleSize class to estimate the number of days that a test must run to achieve the desired significance and power level. @@ -66,12 +67,16 @@ def planning_diff_mean(avg_n_users_per_day, mean_contr, mean_treat, std_contr, a return np.Inf # Compute required sample size - sample_size = SampleSize.ssd_mean(mean_contr, mean_treat, std_contr, alpha, power) + sample_size = SampleSize.ssd_mean( + mean_contr, mean_treat, std_contr, alpha, power + ) - return int(np.ceil(sample_size/avg_n_users_per_day)) + return int(np.ceil(sample_size / avg_n_users_per_day)) @staticmethod - def planning_diff_prop(avg_n_users_per_day, prop_contr, prop_treat, alpha=0.05, power=0.8): + def planning_diff_prop( + avg_n_users_per_day, prop_contr, prop_treat, alpha=0.05, power=0.8 + ): """ Use the sample size determination with proportions comparison from the core.design.SampleSize class to estimate the number of days that a test must run to achieve the desired significance and power level. @@ -109,3 +114,6 @@ def planning_diff_prop(avg_n_users_per_day, prop_contr, prop_treat, alpha=0.05, sample_size = SampleSize.ssd_prop(prop_contr, prop_treat, alpha, power) return int(np.ceil(sample_size / avg_n_users_per_day)) + + +# comment