Spaces:
Sleeping
Sleeping
make table pretty v2
Browse files
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 |
-
|
441 |
-
|
442 |
], data = [
|
443 |
f'{text_cond} {score:.1%}'
|
444 |
-
|
445 |
-
|
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']
|