Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ plt.rcParams.update({
|
|
| 27 |
EP_RANGE = np.linspace(0, 15, 600)
|
| 28 |
|
| 29 |
def calc_paf(episodes, incidence, zscore, rr):
|
| 30 |
-
return 1 - 1 /
|
| 31 |
|
| 32 |
# ββ plot function ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 33 |
def draw(ep, inc, zs, rr):
|
|
@@ -80,7 +80,7 @@ def draw(ep, inc, zs, rr):
|
|
| 80 |
|
| 81 |
# formula watermark
|
| 82 |
ax.text(0.98, 0.05,
|
| 83 |
-
'PAF = 1 β
|
| 84 |
transform=ax.transAxes, fontsize=11,
|
| 85 |
color=C_DIM, ha='right', va='bottom')
|
| 86 |
|
|
@@ -97,8 +97,8 @@ def draw(ep, inc, zs, rr):
|
|
| 97 |
('Ξz / ep.', f'{zs:.3f}', C_ZS),
|
| 98 |
('RR', f'{rr:.3f}', C_RR),
|
| 99 |
('β' * 10, 'β' * 6, C_BORDER),
|
| 100 |
-
('exponent', f'{exponent:.4f}', '#475569'),
|
| 101 |
-
('exp(βx)', f'{1/np.exp(exponent):.4f}', '#475569'),
|
| 102 |
('β' * 10, 'β' * 6, C_BORDER),
|
| 103 |
('PAF', f'{cur_paf*100:.2f}%', ACCENT),
|
| 104 |
]
|
|
@@ -129,7 +129,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="PAF Visualizer") as demo:
|
|
| 129 |
Population Attributable Fraction Visualizer
|
| 130 |
</span><br>
|
| 131 |
<span style="color:#64748b;font-size:13px;">
|
| 132 |
-
PAF = 1 β
|
| 133 |
</span>
|
| 134 |
</div>""")
|
| 135 |
|
|
|
|
| 27 |
EP_RANGE = np.linspace(0, 15, 600)
|
| 28 |
|
| 29 |
def calc_paf(episodes, incidence, zscore, rr):
|
| 30 |
+
return 1 - 1 / (episodes * incidence * zscore * rr)
|
| 31 |
|
| 32 |
# ββ plot function ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 33 |
def draw(ep, inc, zs, rr):
|
|
|
|
| 80 |
|
| 81 |
# formula watermark
|
| 82 |
ax.text(0.98, 0.05,
|
| 83 |
+
'PAF = 1 β 1/(ep Γ inc Γ Ξz Γ RR)',
|
| 84 |
transform=ax.transAxes, fontsize=11,
|
| 85 |
color=C_DIM, ha='right', va='bottom')
|
| 86 |
|
|
|
|
| 97 |
('Ξz / ep.', f'{zs:.3f}', C_ZS),
|
| 98 |
('RR', f'{rr:.3f}', C_RR),
|
| 99 |
('β' * 10, 'β' * 6, C_BORDER),
|
| 100 |
+
#('exponent', f'{exponent:.4f}', '#475569'),
|
| 101 |
+
#('exp(βx)', f'{1/np.exp(exponent):.4f}', '#475569'),
|
| 102 |
('β' * 10, 'β' * 6, C_BORDER),
|
| 103 |
('PAF', f'{cur_paf*100:.2f}%', ACCENT),
|
| 104 |
]
|
|
|
|
| 129 |
Population Attributable Fraction Visualizer
|
| 130 |
</span><br>
|
| 131 |
<span style="color:#64748b;font-size:13px;">
|
| 132 |
+
PAF = 1 β 1/(episodes Γ incidence Γ Ξz Γ RR)
|
| 133 |
</span>
|
| 134 |
</div>""")
|
| 135 |
|