Multiple123 commited on
Commit
d816f90
·
verified ·
1 Parent(s): d77e2a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -57,7 +57,7 @@ def _render_force_plot(base_val: float, shap_1d: np.ndarray, feat_1d: np.ndarray
57
  matplotlib=True, show=False
58
  )
59
  fig = plt.gcf()
60
- fig.set_size_inches(8, 4)
61
  plt.tight_layout()
62
  return fig
63
 
@@ -161,9 +161,9 @@ def predict_and_explain(ALB, TP, TBA, AST_ALT, CREA, LYM, ALP, nsamples=200):
161
  return None, None, f"Fatal error: {repr(e)}"
162
 
163
  # ====== 示例输入(仅 7 项 + nsamples)======
164
- example_values = [38.0, 68.0, 6.5, 1.0, 75.0, 1.2, 80.0, 200]
165
- # 顺序:ALB, TP, TBA, AST_ALT, CREA, LYM, ALP, nsamples
166
- # 注:上例将派生 PNI=ALB+5*LYM=44、AAPR=ALB/ALP=0.475,与训练对齐
167
 
168
  # ====== Gradio 界面 ======
169
  with gr.Blocks() as demo:
 
57
  matplotlib=True, show=False
58
  )
59
  fig = plt.gcf()
60
+ fig.set_size_inches(10, 4)
61
  plt.tight_layout()
62
  return fig
63
 
 
161
  return None, None, f"Fatal error: {repr(e)}"
162
 
163
  # ====== 示例输入(仅 7 项 + nsamples)======
164
+ example_values = [36.4, 57.7, 3.7, 1.0, 74.7, 2.14, 69, 200]
165
+
166
+
167
 
168
  # ====== Gradio 界面 ======
169
  with gr.Blocks() as demo: