in spotify_confidence/samplesize/sample_size_calculator.py [0:0]
def _clean_binomial_mde(absolute_percentage_mde, baseline_proportion):
"""Validate that mde is percentage and not too large.
Args:
absolute_percentage_mde (float): Average absolute minimal
detectable effect size across all tests.
baseline_proportion (float): Baseline metric proportion in
target population.
Returns:
float: Average absolute minimal detectable effect size.
"""
mde = SampleSize._validate_percentage(absolute_percentage_mde)
baseline = SampleSize._validate_percentage(baseline_proportion)
if baseline - mde < 0 and baseline + mde > 1:
raise ValueError("absolute_percentage_mde is too large " "given baseline_proportion")
else:
return mde