wnstnb commited on
Commit
dfd3685
Β·
1 Parent(s): b3c44d6

add performance tab v2

Browse files
Files changed (1) hide show
  1. app.py +17 -1
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
- tab3.write(df_performance)
 
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