Skip to content

Commit a7215c3

Browse files
committed
fix CLES interpretation logic
1 parent 35248b8 commit a7215c3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

treeherder/perf/stats.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from scipy.stats import bootstrap, iqr, ks_2samp, mannwhitneyu
99

1010
# New Stats Code
11+
# various formulas extracted from here:
12+
# https://colab.research.google.com/gist/padenot/2a408f0a39e269977045fc2fb265663b/end-to-end.ipynb#scrollTo=M8WY0yVIX5Ru&uniqifier=1
1113

1214
# p-value threshold to use throughout
1315
PVALUE_THRESHOLD = 0.05
@@ -302,14 +304,18 @@ def interpret_effect_size(delta):
302304
return "large", is_effect_meaningful
303305

304306

305-
def interpret_cles_direction(cles, pvalue_threshold=PVALUE_THRESHOLD):
307+
def interpret_cles_direction(cles):
308+
# probability that a randomly selected score from one group will be greater than a randomly selected score from a second group
309+
# A CLES of 0.5 indicates a 50% chance for either outcome, 50/50 toss up, no change
310+
# A CLES of 0.6 would mean there is a 60% chance that a score Base > New
311+
# A CLES of 0.4 would mean there is a 40% chance that a score from Base > New, or a 60% chance that a score from New > Base
306312
is_base_greater = None
307313
if cles is None:
308314
return "CLES cannot be interpreted", is_base_greater
309-
elif cles > pvalue_threshold:
315+
elif cles > 0.5:
310316
is_base_greater = True
311317
return f"{cles:.0%} chance a base value > a new value", is_base_greater
312-
elif cles < pvalue_threshold:
318+
elif cles < 0.5:
313319
is_base_greater = False
314320
return f"{1 - cles:.0%} chance a new value > base value", is_base_greater
315321
return "CLES cannot be interpreted", is_base_greater

0 commit comments

Comments
 (0)