Spaces:
Runtime error
Runtime error
Duy-Anh Dang
commited on
Commit
·
47382c7
1
Parent(s):
5e2e1e9
testing with container
Browse files
app.py
CHANGED
@@ -241,29 +241,30 @@ if st.button('Generate Predictions'):
|
|
241 |
recommended_changes=(best_target_tones)
|
242 |
change=best_target-pred
|
243 |
#recommend(tones,recommended_changes,change,target)
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
|
|
268 |
|
269 |
placeholder.empty()
|
|
|
241 |
recommended_changes=(best_target_tones)
|
242 |
change=best_target-pred
|
243 |
#recommend(tones,recommended_changes,change,target)
|
244 |
+
with st.container():
|
245 |
+
fig2 = go.Figure()
|
246 |
+
fig2.add_trace(go.Bar(
|
247 |
+
y=tone_labels,
|
248 |
+
x=recommended_changes,
|
249 |
+
name='Recommend changes',
|
250 |
+
orientation='h',
|
251 |
+
text=np.round(recommended_changes,3),
|
252 |
+
width=.5,
|
253 |
+
marker=dict(
|
254 |
+
color='#e60f00',
|
255 |
+
line=dict(color='rgba(58, 71, 80, 1.0)', width=1)))
|
256 |
+
)
|
257 |
+
fig2.update_traces(textfont_size=18, textposition="outside", cliponaxis=False)
|
258 |
+
if target == 'Revenue_Per_Email':
|
259 |
+
out = f"${round(change,2)}"
|
260 |
+
st.write("The output will be between the range " + str(round(lower,2)) + ' and ' + str(round(upper,2)))
|
261 |
+
st.write("The Predicted "+str(target) +" is "+ str(round(pred,2)))
|
262 |
+
else:
|
263 |
+
out = f"{round(change,2)*100}%"
|
264 |
+
st.write("The output will be between the range " + str(round(lower,2) * 100) + ' and ' + str(round(upper,2) *100))
|
265 |
+
st.write("The Predicted "+str(target) +" is "+ str(round(pred,2)*100))
|
266 |
+
fig2.update_layout(title_text=f'The following Changes will yield a {out} increase in {target}')
|
267 |
+
st.plotly_chart(fig2, use_container_width=True)
|
268 |
+
#FunctionsModelSA_V1.corrections(best_target_tones,test_predictions))
|
269 |
|
270 |
placeholder.empty()
|