Spaces:
Sleeping
Sleeping
Pragya Jatav
commited on
Commit
·
7bda0a5
1
Parent(s):
636c74e
version changes
Browse files- pages/1_Model_Quality.py +57 -0
- pages/2_Scenario_Planner.py +2 -1
pages/1_Model_Quality.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import plotly.express as px
|
| 5 |
+
import Streamlit_functions as sf
|
| 6 |
+
import response_curves_model_quality_base as rc1
|
| 7 |
+
st.set_page_config(
|
| 8 |
+
layout="wide"
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
st.header("Model Quality")
|
| 13 |
+
st.write("MMM Model Quality")
|
| 14 |
+
|
| 15 |
+
st.plotly_chart(sf.mmm_model_quality(),use_container_width=True)
|
| 16 |
+
|
| 17 |
+
media_df = sf.media_data()
|
| 18 |
+
# Create two columns for start date and end date input
|
| 19 |
+
col1, col2 = st.columns(2)
|
| 20 |
+
|
| 21 |
+
st.table(sf.model_metrics_table_func())
|
| 22 |
+
|
| 23 |
+
with col1:
|
| 24 |
+
st.plotly_chart(sf.elasticity(media_df))
|
| 25 |
+
with col2:
|
| 26 |
+
st.plotly_chart(sf.half_life(media_df))
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
# Dropdown menu options
|
| 30 |
+
options = [
|
| 31 |
+
'Broadcast TV',
|
| 32 |
+
'Cable TV',
|
| 33 |
+
'Connected & OTT TV',
|
| 34 |
+
'Display Prospecting',
|
| 35 |
+
'Display Retargeting',
|
| 36 |
+
'Video',
|
| 37 |
+
'Social Prospecting',
|
| 38 |
+
'Social Retargeting',
|
| 39 |
+
'Search Brand',
|
| 40 |
+
'Search Non-brand',
|
| 41 |
+
'Digital Partners',
|
| 42 |
+
'Audio',
|
| 43 |
+
'Email']
|
| 44 |
+
options1 = [
|
| 45 |
+
'View Line Plot',
|
| 46 |
+
'View Scattered Plot',
|
| 47 |
+
"View Both"]
|
| 48 |
+
col1, col2 = st.columns(2)
|
| 49 |
+
# Create a dropdown menu
|
| 50 |
+
with col1:
|
| 51 |
+
selected_option = st.selectbox('Select a media channel:', options)
|
| 52 |
+
selected_option2 = st.selectbox('Select a Chart Type', options1)
|
| 53 |
+
# Display the selected option
|
| 54 |
+
st.plotly_chart(rc1.response_curves(selected_option,selected_option2))
|
| 55 |
+
with col2:
|
| 56 |
+
st.write("")
|
| 57 |
+
|
pages/2_Scenario_Planner.py
CHANGED
|
@@ -23,7 +23,8 @@ import warnings
|
|
| 23 |
# Suppress specific warnings if necessary
|
| 24 |
warnings.filterwarnings("ignore")
|
| 25 |
warnings.filterwarnings("ignore", category=UserWarning, message="The widget with key")
|
| 26 |
-
|
|
|
|
| 27 |
from classes import class_from_dict, class_to_dict
|
| 28 |
import pickle
|
| 29 |
import streamlit_authenticator as stauth
|
|
|
|
| 23 |
# Suppress specific warnings if necessary
|
| 24 |
warnings.filterwarnings("ignore")
|
| 25 |
warnings.filterwarnings("ignore", category=UserWarning, message="The widget with key")
|
| 26 |
+
# for i in :
|
| 27 |
+
# warnings.filterwarnings("ignore",)
|
| 28 |
from classes import class_from_dict, class_to_dict
|
| 29 |
import pickle
|
| 30 |
import streamlit_authenticator as stauth
|