-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.py
33 lines (27 loc) · 1.55 KB
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import streamlit as st
import pandas as pd
def save_results_in_session_state(experiment, control_label, treatment_label):
st.session_state.experiment_results = experiment.results
st.session_state.treatment_stats = pd.DataFrame.from_dict(
experiment.results[treatment_label]["statistics"]
)
st.session_state.control_stats = pd.DataFrame.from_dict(
experiment.results[control_label]["statistics"]
)
def explain_metrics():
st.write(
"""
- **chance_to_beat**: chance that the variant is better than the other.
- **expected_loss**: a measure of the risk you're assuming if you stay with this variant. The lower the risk, the best (e.g: 0.10 in conversion means that your risk of staying with the variant compared to the other is to lose 10% p.p. 0.10 for arpu is a risk of loosing $0.10 per user.)
- **lift**: the observed relative difference compared to the other variant for each metric.
- **diff**: the observed absolute difference compared to the other variant for each metric.
"""
)
def print_warning():
st.warning(
"""
We're making a major breaking change in the project to use the [bayesian-testing](https://github.com/Matt52/bayesian-testing) library for better experiment management,
and a full stack application will be developed to build a website for Janus, so this Streamlit application will be discontinued.
Please, consider using the [distributed package in pypi](https://pypi.org/project/janus-web-ab-testing/), which comes from the `evolve-janus-backend` branch.
"""
)