Spaces:
Sleeping
Sleeping
add performance tab v2
Browse files
app.py
CHANGED
@@ -488,6 +488,21 @@ if st.button('π€ Run it'):
|
|
488 |
]
|
489 |
).round(2)
|
490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
tab1.subheader('Preds and Probabilities')
|
492 |
tab1.write(results)
|
493 |
tab1.write(df_probas)
|
@@ -499,7 +514,8 @@ if st.button('π€ Run it'):
|
|
499 |
tab3.write(df_final)
|
500 |
|
501 |
tab4.subheader('Performance')
|
502 |
-
|
|
|
503 |
|
504 |
# The only variable you can play with as the other ones are historical
|
505 |
# new_pred.loc[:,'CurrentGap'] = -0.01 / 100
|
|
|
488 |
]
|
489 |
).round(2)
|
490 |
|
491 |
+
def get_acc(t, p):
|
492 |
+
if t == False and p <= 0.4:
|
493 |
+
return 'β
'
|
494 |
+
elif t == True and p > 0.6:
|
495 |
+
return 'β
'
|
496 |
+
elif t == False and p > 0.6:
|
497 |
+
return 'β'
|
498 |
+
elif t == True and p <= 0.4:
|
499 |
+
return 'β'
|
500 |
+
else:
|
501 |
+
return 'π¨'
|
502 |
+
|
503 |
+
perf_daily = res1.copy()
|
504 |
+
perf_daily['Accuracy'] = [get_acc(t, p) for t, p in zip(perf_daily['True'], perf_daily['Predicted'])]
|
505 |
+
|
506 |
tab1.subheader('Preds and Probabilities')
|
507 |
tab1.write(results)
|
508 |
tab1.write(df_probas)
|
|
|
514 |
tab3.write(df_final)
|
515 |
|
516 |
tab4.subheader('Performance')
|
517 |
+
tab4.write(df_performance)
|
518 |
+
tab4.write(perf_daily)
|
519 |
|
520 |
# The only variable you can play with as the other ones are historical
|
521 |
# new_pred.loc[:,'CurrentGap'] = -0.01 / 100
|