wnstnb commited on
Commit
d4e85ea
Β·
1 Parent(s): 12088f9

make table pretty v2

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -404,9 +404,13 @@ if st.button('πŸ€– Run it'):
404
  operator = None
405
 
406
  if do_not_play:
407
- text_cond = '⚠'
408
  operator = ''
409
  score = seq_proba[0]
 
 
 
 
410
 
411
  elif green_proba > red_proba:
412
  # If the day is predicted to be green, say so
@@ -437,12 +441,12 @@ if st.button('πŸ€– Run it'):
437
 
438
  results = pd.DataFrame(index=[
439
  'ModelScore'
440
- # 'HistoricalRate'
441
- # f'Num {operator} {"" if do_not_play else score_fmt}',
442
  ], data = [
443
  f'{text_cond} {score:.1%}'
444
- # f'{text_cond} {historical_proba:.1%}',
445
- # num_obs
446
  ])
447
 
448
  results.columns = ['Outputs']
 
404
  operator = None
405
 
406
  if do_not_play:
407
+ text_cond = '🟨'
408
  operator = ''
409
  score = seq_proba[0]
410
+ cond = (res1['Predicted'] > 0.4) & (res1['Predicted'] <= 0.6)
411
+ num_obs = len(res1.loc[cond])
412
+ historical_proba = res1.loc[cond, 'True'].mean()
413
+
414
 
415
  elif green_proba > red_proba:
416
  # If the day is predicted to be green, say so
 
441
 
442
  results = pd.DataFrame(index=[
443
  'ModelScore'
444
+ 'HistoricalRate'
445
+ f'Num {operator} {"" if do_not_play else score_fmt}',
446
  ], data = [
447
  f'{text_cond} {score:.1%}'
448
+ f'{text_cond} {historical_proba:.1%}',
449
+ num_obs
450
  ])
451
 
452
  results.columns = ['Outputs']