Spaces:
Runtime error
Runtime error
bug fixing for df_recom_extra
Browse files
app.py
CHANGED
|
@@ -648,7 +648,7 @@ def get_predictions(selected_variable, selected_industry, selected_campaign,
|
|
| 648 |
st.markdown('##### selected_cta is: <span style="color:yellow">{}</span>'.format(selected_cta), unsafe_allow_html=True)
|
| 649 |
if selected_cta == 'Color':
|
| 650 |
df_recom = df_recom_sort.drop_duplicates(subset=['cta_color'], keep='last')
|
| 651 |
-
st.markdown('##### df_recom is: <span style="color:yellow">{}</span>'.format(df_recom), unsafe_allow_html=True)
|
| 652 |
|
| 653 |
|
| 654 |
replaces = False
|
|
@@ -664,10 +664,9 @@ def get_predictions(selected_variable, selected_industry, selected_campaign,
|
|
| 664 |
|
| 665 |
print(f"\nTo get a higher {selected_variable}, the model recommends the following options: ")
|
| 666 |
if len(df_recom_opt_rank_out) < 2:
|
| 667 |
-
st.markdown('##### Youve already achieved the highest {} with the current Call-To-Action Colors!'.format(selected_variable), unsafe_allow_html=True)
|
| 668 |
# print("You've already achieved the highest", selected_variable,
|
| 669 |
# "with the current Call-To-Action Colors!")
|
| 670 |
-
st.markdown('##### df_recom_extra: {}'.format(df_recom_extra), unsafe_allow_html=True)
|
| 671 |
increment = output_rate + (0.02*3)
|
| 672 |
for _, row in df_recom_extra.iterrows():
|
| 673 |
target_rate = random.uniform(increment - 0.02, increment)
|
|
@@ -683,6 +682,8 @@ def get_predictions(selected_variable, selected_industry, selected_campaign,
|
|
| 683 |
for _, row in df_recom_opt_rank_out.iterrows():
|
| 684 |
target_rate = row[4]
|
| 685 |
recom_cta = row[2]
|
|
|
|
|
|
|
| 686 |
print(f" {(color(' ', fore='#ffffff', back=recom_cta))} \x1b[1m{round(target_rate*100, 2)}%\x1b[22m")
|
| 687 |
|
| 688 |
elif selected_cta == 'Text':
|
|
|
|
| 648 |
st.markdown('##### selected_cta is: <span style="color:yellow">{}</span>'.format(selected_cta), unsafe_allow_html=True)
|
| 649 |
if selected_cta == 'Color':
|
| 650 |
df_recom = df_recom_sort.drop_duplicates(subset=['cta_color'], keep='last')
|
| 651 |
+
# st.markdown('##### df_recom is: <span style="color:yellow">{}</span>'.format(df_recom), unsafe_allow_html=True)
|
| 652 |
|
| 653 |
|
| 654 |
replaces = False
|
|
|
|
| 664 |
|
| 665 |
print(f"\nTo get a higher {selected_variable}, the model recommends the following options: ")
|
| 666 |
if len(df_recom_opt_rank_out) < 2:
|
| 667 |
+
# st.markdown('##### Youve already achieved the highest {} with the current Call-To-Action Colors!'.format(selected_variable), unsafe_allow_html=True)
|
| 668 |
# print("You've already achieved the highest", selected_variable,
|
| 669 |
# "with the current Call-To-Action Colors!")
|
|
|
|
| 670 |
increment = output_rate + (0.02*3)
|
| 671 |
for _, row in df_recom_extra.iterrows():
|
| 672 |
target_rate = random.uniform(increment - 0.02, increment)
|
|
|
|
| 682 |
for _, row in df_recom_opt_rank_out.iterrows():
|
| 683 |
target_rate = row[4]
|
| 684 |
recom_cta = row[2]
|
| 685 |
+
st.markdown('##### recom_cta is: <span style="color:yellow">{}</span>'.format(recom_cta), unsafe_allow_html=True)
|
| 686 |
+
st.markdown('##### target_rate for recom_cta is: <span style="color:yellow">{}</span>'.format(target_rate), unsafe_allow_html=True)
|
| 687 |
print(f" {(color(' ', fore='#ffffff', back=recom_cta))} \x1b[1m{round(target_rate*100, 2)}%\x1b[22m")
|
| 688 |
|
| 689 |
elif selected_cta == 'Text':
|