Spaces:
Sleeping
Sleeping
Pragya Jatav
commited on
Commit
·
e015ebb
1
Parent(s):
68fa2e2
aesthetic changes 2
Browse files- __pycache__/Streamlit_functions.cpython-310.pyc +0 -0
- __pycache__/response_curves_model_quality.cpython-310.pyc +0 -0
- __pycache__/response_curves_model_quality_base.cpython-310.pyc +0 -0
- pages/2_Scenario_Planner.py +6 -6
- response_curves_model_quality.py +2 -1
- response_curves_model_quality_base.py +2 -2
- summary_df.pkl +1 -1
__pycache__/Streamlit_functions.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/Streamlit_functions.cpython-310.pyc and b/__pycache__/Streamlit_functions.cpython-310.pyc differ
|
|
|
__pycache__/response_curves_model_quality.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/response_curves_model_quality.cpython-310.pyc and b/__pycache__/response_curves_model_quality.cpython-310.pyc differ
|
|
|
__pycache__/response_curves_model_quality_base.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/response_curves_model_quality_base.cpython-310.pyc and b/__pycache__/response_curves_model_quality_base.cpython-310.pyc differ
|
|
|
pages/2_Scenario_Planner.py
CHANGED
|
@@ -875,7 +875,7 @@ def scenario_planner_plots():
|
|
| 875 |
# Add actual vs optimized spend bars
|
| 876 |
|
| 877 |
|
| 878 |
-
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'], y=summary_df_sorted['Actual_spend'], name='Actual',
|
| 879 |
text=summary_df_sorted['Actual_spend'].apply(format_number) + ' '
|
| 880 |
# +
|
| 881 |
# ' '+
|
|
@@ -884,7 +884,7 @@ def scenario_planner_plots():
|
|
| 884 |
marker_color=light_blue))
|
| 885 |
|
| 886 |
|
| 887 |
-
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'], y=summary_df_sorted['Optimized_spend'], name='Optimized',
|
| 888 |
text=summary_df_sorted['Optimized_spend'].apply(format_number) + ' '
|
| 889 |
# +
|
| 890 |
# '</br> (' + optimized_spend_percentage.astype(int).astype(str) + '%)'
|
|
@@ -902,11 +902,11 @@ def scenario_planner_plots():
|
|
| 902 |
|
| 903 |
# Add actual vs optimized Contribution
|
| 904 |
fig = go.Figure()
|
| 905 |
-
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'], y=summary_df_sorted['Old_sales'],
|
| 906 |
name='Actual Contribution',text=summary_df_sorted['Old_sales'].apply(format_number),textposition='outside',
|
| 907 |
marker_color=light_blue,showlegend=True))
|
| 908 |
|
| 909 |
-
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'], y=summary_df_sorted['New_sales'],
|
| 910 |
name='Optimized Contribution',text=summary_df_sorted['New_sales'].apply(format_number),textposition='outside',
|
| 911 |
marker_color=light_orange, showlegend=True))
|
| 912 |
|
|
@@ -924,10 +924,10 @@ def scenario_planner_plots():
|
|
| 924 |
# Add actual vs optimized Efficiency bars
|
| 925 |
fig = go.Figure()
|
| 926 |
summary_df_sorted_p = summary_df_sorted[summary_df_sorted['Channel_name']!="Panel"]
|
| 927 |
-
fig.add_trace(go.Bar(x=summary_df_sorted_p['Channel_name'], y=summary_df_sorted_p['old_efficiency'],
|
| 928 |
name='Actual Efficiency', text=summary_df_sorted_p['old_efficiency'].apply(format_number) ,textposition='outside',
|
| 929 |
marker_color=light_blue,showlegend=True))
|
| 930 |
-
fig.add_trace(go.Bar(x=summary_df_sorted_p['Channel_name'], y=summary_df_sorted_p['new_efficiency'],
|
| 931 |
name='Optimized Efficiency',text=summary_df_sorted_p['new_efficiency'].apply(format_number),textposition='outside' ,
|
| 932 |
marker_color=light_orange,showlegend=True))
|
| 933 |
|
|
|
|
| 875 |
# Add actual vs optimized spend bars
|
| 876 |
|
| 877 |
|
| 878 |
+
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'].apply(channel_name_formating), y=summary_df_sorted['Actual_spend'], name='Actual',
|
| 879 |
text=summary_df_sorted['Actual_spend'].apply(format_number) + ' '
|
| 880 |
# +
|
| 881 |
# ' '+
|
|
|
|
| 884 |
marker_color=light_blue))
|
| 885 |
|
| 886 |
|
| 887 |
+
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'].apply(channel_name_formating), y=summary_df_sorted['Optimized_spend'], name='Optimized',
|
| 888 |
text=summary_df_sorted['Optimized_spend'].apply(format_number) + ' '
|
| 889 |
# +
|
| 890 |
# '</br> (' + optimized_spend_percentage.astype(int).astype(str) + '%)'
|
|
|
|
| 902 |
|
| 903 |
# Add actual vs optimized Contribution
|
| 904 |
fig = go.Figure()
|
| 905 |
+
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'].apply(channel_name_formating), y=summary_df_sorted['Old_sales'],
|
| 906 |
name='Actual Contribution',text=summary_df_sorted['Old_sales'].apply(format_number),textposition='outside',
|
| 907 |
marker_color=light_blue,showlegend=True))
|
| 908 |
|
| 909 |
+
fig.add_trace(go.Bar(x=summary_df_sorted['Channel_name'].apply(channel_name_formating), y=summary_df_sorted['New_sales'],
|
| 910 |
name='Optimized Contribution',text=summary_df_sorted['New_sales'].apply(format_number),textposition='outside',
|
| 911 |
marker_color=light_orange, showlegend=True))
|
| 912 |
|
|
|
|
| 924 |
# Add actual vs optimized Efficiency bars
|
| 925 |
fig = go.Figure()
|
| 926 |
summary_df_sorted_p = summary_df_sorted[summary_df_sorted['Channel_name']!="Panel"]
|
| 927 |
+
fig.add_trace(go.Bar(x=summary_df_sorted_p['Channel_name'].apply(channel_name_formating), y=summary_df_sorted_p['old_efficiency'],
|
| 928 |
name='Actual Efficiency', text=summary_df_sorted_p['old_efficiency'].apply(format_number) ,textposition='outside',
|
| 929 |
marker_color=light_blue,showlegend=True))
|
| 930 |
+
fig.add_trace(go.Bar(x=summary_df_sorted_p['Channel_name'].apply(channel_name_formating), y=summary_df_sorted_p['new_efficiency'],
|
| 931 |
name='Optimized Efficiency',text=summary_df_sorted_p['new_efficiency'].apply(format_number),textposition='outside' ,
|
| 932 |
marker_color=light_orange,showlegend=True))
|
| 933 |
|
response_curves_model_quality.py
CHANGED
|
@@ -6,6 +6,7 @@ from sklearn.preprocessing import MinMaxScaler
|
|
| 6 |
import warnings
|
| 7 |
warnings.filterwarnings("ignore")
|
| 8 |
import plotly.graph_objects as go
|
|
|
|
| 9 |
|
| 10 |
## reading input data
|
| 11 |
df= pd.read_csv('response_curves_input_file.csv')
|
|
@@ -479,7 +480,7 @@ def response_curves(channel,x_modified,y_modified):
|
|
| 479 |
|
| 480 |
# Update layout with titles
|
| 481 |
fig.update_layout(
|
| 482 |
-
title=channel+' Response Curve',
|
| 483 |
xaxis_title='Weekly Spends',
|
| 484 |
yaxis_title='Prospects'
|
| 485 |
)
|
|
|
|
| 6 |
import warnings
|
| 7 |
warnings.filterwarnings("ignore")
|
| 8 |
import plotly.graph_objects as go
|
| 9 |
+
from utilities import (channel_name_formating)
|
| 10 |
|
| 11 |
## reading input data
|
| 12 |
df= pd.read_csv('response_curves_input_file.csv')
|
|
|
|
| 480 |
|
| 481 |
# Update layout with titles
|
| 482 |
fig.update_layout(
|
| 483 |
+
title=channel_name_formating(channel)+' Response Curve',
|
| 484 |
xaxis_title='Weekly Spends',
|
| 485 |
yaxis_title='Prospects'
|
| 486 |
)
|
response_curves_model_quality_base.py
CHANGED
|
@@ -6,7 +6,7 @@ from sklearn.preprocessing import MinMaxScaler
|
|
| 6 |
import warnings
|
| 7 |
warnings.filterwarnings("ignore")
|
| 8 |
import plotly.graph_objects as go
|
| 9 |
-
|
| 10 |
## reading input data
|
| 11 |
df= pd.read_csv('response_curves_input_file.csv')
|
| 12 |
df.dropna(inplace=True)
|
|
@@ -221,7 +221,7 @@ def response_curves(channel,chart_typ):
|
|
| 221 |
# Update layout with titles
|
| 222 |
fig.update_layout(
|
| 223 |
width=700, height=500,
|
| 224 |
-
title=channel+' Response Curve',
|
| 225 |
xaxis_title='Weekly Spends',
|
| 226 |
yaxis_title='Prospects'
|
| 227 |
)
|
|
|
|
| 6 |
import warnings
|
| 7 |
warnings.filterwarnings("ignore")
|
| 8 |
import plotly.graph_objects as go
|
| 9 |
+
from utilities_with_panel import (channel_name_formating)
|
| 10 |
## reading input data
|
| 11 |
df= pd.read_csv('response_curves_input_file.csv')
|
| 12 |
df.dropna(inplace=True)
|
|
|
|
| 221 |
# Update layout with titles
|
| 222 |
fig.update_layout(
|
| 223 |
width=700, height=500,
|
| 224 |
+
title=channel_name_formating(channel)+' Response Curve',
|
| 225 |
xaxis_title='Weekly Spends',
|
| 226 |
yaxis_title='Prospects'
|
| 227 |
)
|
summary_df.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1822
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bb50f23e164ddf0cae9b81a28e47f97561d83e444b951bcf2e8192d70eadc7ce
|
| 3 |
size 1822
|