HugBot commited on
Commit
edafbb5
Β·
verified Β·
1 Parent(s): 79b270b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 / np.exp(episodes * incidence * zscore * rr)
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 βˆ’ exp(βˆ’ep Γ— inc Γ— Ξ”z Γ— RR)',
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 βˆ’ exp(βˆ’episodes Γ— incidence Γ— Ξ”z Γ— RR)
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