mertkarabacak commited on
Commit
10d625f
1 Parent(s): c8437c5

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -166,7 +166,7 @@ def y1_interpret_xgb(*args):
166
  scores_desc = list(zip(shap_values[0], x1.columns))
167
  scores_desc = sorted(scores_desc)
168
  fig_m = plt.figure(facecolor='white')
169
- fig_m.set_size_inches(10, 18)
170
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
171
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
172
  plt.yticks(fontsize=12)
@@ -181,7 +181,7 @@ def y1_interpret_lgb(*args):
181
  scores_desc = list(zip(shap_values[0][0], x1.columns))
182
  scores_desc = sorted(scores_desc)
183
  fig_m = plt.figure(facecolor='white')
184
- fig_m.set_size_inches(10, 18)
185
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
186
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
187
  plt.yticks(fontsize=12)
@@ -196,7 +196,7 @@ def y1_interpret_cb(*args):
196
  scores_desc = list(zip(shap_values[0], x1.columns))
197
  scores_desc = sorted(scores_desc)
198
  fig_m = plt.figure(facecolor='white')
199
- fig_m.set_size_inches(10, 18)
200
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
201
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
202
  plt.yticks(fontsize=12)
@@ -211,7 +211,7 @@ def y1_interpret_rf(*args):
211
  scores_desc = list(zip(shap_values[0][0], x1_rf.columns))
212
  scores_desc = sorted(scores_desc)
213
  fig_m = plt.figure(facecolor='white')
214
- fig_m.set_size_inches(10, 18)
215
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
216
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
217
  plt.yticks(fontsize=12)
@@ -425,11 +425,21 @@ with gr.Blocks(title = "NTDB-Epidural") as demo:
425
 
426
  with gr.Box():
427
  with gr.Row():
428
-
429
- gr.Markdown(
430
  """
431
  <br/>
 
 
 
 
 
432
  ## Mortality
 
 
 
 
 
433
  <br/>
434
  """
435
  )
 
166
  scores_desc = list(zip(shap_values[0], x1.columns))
167
  scores_desc = sorted(scores_desc)
168
  fig_m = plt.figure(facecolor='white')
169
+ fig_m.set_size_inches(4, 12)
170
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
171
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
172
  plt.yticks(fontsize=12)
 
181
  scores_desc = list(zip(shap_values[0][0], x1.columns))
182
  scores_desc = sorted(scores_desc)
183
  fig_m = plt.figure(facecolor='white')
184
+ fig_m.set_size_inches(4, 12)
185
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
186
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
187
  plt.yticks(fontsize=12)
 
196
  scores_desc = list(zip(shap_values[0], x1.columns))
197
  scores_desc = sorted(scores_desc)
198
  fig_m = plt.figure(facecolor='white')
199
+ fig_m.set_size_inches(4, 12)
200
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
201
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
202
  plt.yticks(fontsize=12)
 
211
  scores_desc = list(zip(shap_values[0][0], x1_rf.columns))
212
  scores_desc = sorted(scores_desc)
213
  fig_m = plt.figure(facecolor='white')
214
+ fig_m.set_size_inches(4, 12)
215
  plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
216
  plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
217
  plt.yticks(fontsize=12)
 
425
 
426
  with gr.Box():
427
  with gr.Row():
428
+
429
+ gr.Markdown(
430
  """
431
  <br/>
432
+ """
433
+ )
434
+
435
+ gr.Markdown(
436
+ """
437
  ## Mortality
438
+ """
439
+ )
440
+
441
+ gr.Markdown(
442
+ """
443
  <br/>
444
  """
445
  )