Skip to content

Commit

Permalink
fix revenue report for avg ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
lgabs committed Apr 11, 2024
1 parent 546c084 commit 2bb7c0b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions janus/stats/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,19 @@ def consolidate_results(self, variantA: Variant, variantB: Variant):
variant_interest.users + variant_other.users
)
for metric in self.keymetrics:
print("metric: ", metric)
if metric == "revenue":
# for variances, revenue modelling is the ticket
# this is a confusion to be fixed in the future
_metric = "ticket"
else:
_metric = metric
interest_value = getattr(variant_interest, _metric)
other_value = getattr(variant_other, _metric)
results["statistics"][metric]["lift"] = get_lift(
getattr(variant_interest, metric), getattr(variant_other, metric)
interest_value, other_value
)
results["statistics"][metric]["diff"] = getattr(
variant_interest, metric
) - getattr(variant_other, metric)
results["statistics"][metric]["diff"] = interest_value - other_value

self.results[variant_interest.name] = results

Expand Down

0 comments on commit 2bb7c0b

Please sign in to comment.