Spaces:
Runtime error
Runtime error
File size: 22,464 Bytes
9aba401 49d9310 9aba401 fc152b8 9aba401 2d939f1 9aba401 2d939f1 9aba401 2d939f1 9aba401 18a7fec 9aba401 fc152b8 9aba401 fc152b8 9aba401 cfa1f51 9aba401 cfa1f51 9aba401 b7aa586 7052132 b7aa586 9aba401 b7aa586 4e03e15 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
import os
HF_TOKEN = os.getenv("HF_TOKEN")
import numpy as np
import pandas as pd
import sklearn
import sklearn.metrics
from sklearn.metrics import roc_auc_score, roc_curve, precision_recall_curve, auc, precision_score, recall_score, f1_score, classification_report, accuracy_score, confusion_matrix, ConfusionMatrixDisplay, matthews_corrcoef
from sklearn.model_selection import train_test_split
from sklearn.calibration import calibration_curve
from scipy import stats as st
from random import randrange
from matplotlib import pyplot as plt
from scipy.special import softmax
import xgboost as xgb
import lightgbm as lgb
import catboost as cb
from catboost import Pool
from sklearn.ensemble import RandomForestClassifier
import optuna
import shap
import gradio as gr
import random
#Read and redefine data.
from datasets import load_dataset
data = load_dataset("mertkarabacak/NSQIP-CDA", data_files="cda_imputed.csv", use_auth_token = HF_TOKEN)
data = pd.DataFrame(data['train'])
variables = ['SEX', 'TRANST', 'AGE', 'SURGSPEC', 'HEIGHT', 'WEIGHT', 'DIABETES', 'SMOKE', 'DYSPNEA', 'FNSTATUS2', 'VENTILAT', 'HXCOPD', 'ASCITES', 'HXCHF', 'HYPERMED', 'RENAFAIL', 'DIALYSIS', 'DISCANCR', 'WNDINF', 'STEROID', 'WTLOSS', 'BLEEDDIS', 'TRANSFUS', 'PRSODM', 'PRBUN', 'PRCREAT', 'PRWBC', 'PRHCT', 'PRPLATE', 'ASACLAS', 'BMI', 'RACE', 'LEVELS', 'ADVERSE_OUTCOME']
data = data[variables]
data['SEX'] = data['SEX'].replace(['male'], 'Male')
data['SEX'] = data['SEX'].replace(['female'], 'Female')
print(data.columns)
#Define outcomes.
x = data
y1 = data.pop('ADVERSE_OUTCOME')
y1 = (y1 == "Yes").astype(int)
categorical_columns = list(x.select_dtypes('object').columns)
x = x.astype({col: "category" for col in categorical_columns})
#Prepare data for AE (y1).
y1_data_xgb = xgb.DMatrix(x, label=y1, enable_categorical=True)
y1_data_lgb = lgb.Dataset(x, label=y1)
y1_data_cb = Pool(data=x, label=y1, cat_features=categorical_columns)
#Prepare data for Random Forest models.
x_rf = x
categorical_columns = list(x_rf.select_dtypes('category').columns)
x_rf = x_rf.astype({col: "category" for col in categorical_columns})
le = sklearn.preprocessing.LabelEncoder()
for col in categorical_columns:
x_rf[col] = le.fit_transform(x_rf[col].astype(str))
d1 = dict.fromkeys(x_rf.select_dtypes(np.int64).columns, str)
x_rf = x_rf.astype(d1)
#Assign unique values as answer options.
unique_sex = ['Male', 'Female']
unique_race = ['White', 'Black or African American', 'Hispanic', 'Asian', 'Other', 'Unknown']
unique_transt = ['Not transferred', 'Transferred', 'Unknown']
unique_diabetes = ['No', 'Yes']
unique_smoke = ['No', 'Yes']
unique_dyspnea = ['No', 'Yes']
unique_ventilat = ['No', 'Yes']
unique_hxcopd = ['No', 'Yes']
unique_ascites = ['No', 'Yes']
unique_hxchf = ['No', 'Yes']
unique_hypermed = ['No', 'Yes']
unique_renafail = ['No', 'Yes']
unique_dialysis = ['No', 'Yes']
unique_discancr = ['No', 'Yes']
unique_steroid = ['No', 'Yes']
unique_wtloss = ['No', 'Yes']
unique_bleeddis = ['No', 'Yes']
unique_transfus = ['No', 'Yes']
unique_wndinf = ['No', 'Yes']
unique_asaclas = ['1-No Disturb', '2-Mild Disturb','3-Severe Disturb']
unique_fnstatus2 = ['Independent', 'Partially Dependent', 'Totally Dependent', 'Unknown']
unique_surgspec = ['Neurosurgery', 'Orthopedics']
unique_levels = ['Single', 'Multiple']
#Assign hyperparameters.
y1_xgb_params = {'objective': 'binary:logistic', 'booster': 'gbtree', 'lambda': 0.5510926378114541, 'alpha': 2.0796731320109623e-05, 'max_depth': 8, 'eta': 0.7105161360756392, 'gamma': 0.0063548351925993354, 'grow_policy': 'lossguide'}
y1_lgb_params = {'objective': 'binary', 'boosting_type': 'gbdt', 'lambda_l1': 0.00015201438108112603, 'lambda_l2': 1.2678336645891737e-05, 'num_leaves': 201, 'feature_fraction': 0.7349321144466956, 'bagging_fraction': 0.9213936471712818, 'bagging_freq': 2, 'min_child_samples': 27}
y1_cb_params = {'objective': 'Logloss', 'colsample_bylevel': 0.08511055529750637, 'depth': 12, 'boosting_type': 'Plain', 'bootstrap_type': 'Bayesian', 'bagging_temperature': 3.571269095878882}
y1_rf_params = {'criterion': 'entropy', 'max_features': 'sqrt', 'max_depth': 90, 'n_estimators': 900, 'min_samples_leaf': 1, 'min_samples_split': 2}
#Modeling for y1/AE.
y1_model_xgb = xgb.train(params=y1_xgb_params, dtrain=y1_data_xgb)
y1_explainer_xgb = shap.TreeExplainer(y1_model_xgb)
y1_model_lgb = lgb.train(params=y1_lgb_params, train_set=y1_data_lgb)
y1_explainer_lgb = shap.TreeExplainer(y1_model_lgb)
y1_model_cb = cb.train(pool=y1_data_cb, params=y1_cb_params)
y1_explainer_cb = shap.TreeExplainer(y1_model_cb)
from sklearn.ensemble import RandomForestClassifier as rf
y1_rf = rf(**y1_rf_params)
y1_model_rf = y1_rf.fit(x_rf, y1)
y1_explainer_rf = shap.TreeExplainer(y1_model_rf)
#Define predict for y1/AE.
def y1_predict_xgb(*args):
df_xgb = pd.DataFrame([args], columns=x.columns)
df_xgb = df_xgb.astype({col: "category" for col in categorical_columns})
pos_pred = y1_model_xgb.predict(xgb.DMatrix(df_xgb, enable_categorical=True))
return {"Adverse Outcomes": float(pos_pred[0]), "No Adverse Outcomes": 1 - float(pos_pred[0])}
def y1_predict_lgb(*args):
df = pd.DataFrame([args], columns=data.columns)
df = df.astype({col: "category" for col in categorical_columns})
pos_pred = y1_model_lgb.predict(df)
return {"Adverse Outcomes": float(pos_pred[0]), "No Adverse Outcomes": 1 - float(pos_pred[0])}
def y1_predict_cb(*args):
df_cb = pd.DataFrame([args], columns=x.columns)
df_cb = df_cb.astype({col: "category" for col in categorical_columns})
pos_pred = y1_model_cb.predict(Pool(df_cb, cat_features = categorical_columns), prediction_type='Probability')
return {"Adverse Outcomes": float(pos_pred[0][1]), "No Adverse Outcomes": float(pos_pred[0][0])}
def y1_predict_rf(*args):
df = pd.DataFrame([args], columns=x_rf.columns)
df = df.astype({col: "category" for col in categorical_columns})
d = dict.fromkeys(df.select_dtypes(np.int64).columns, np.int32)
df = df.astype(d)
pos_pred = y1_model_rf.predict_proba(df)
return {"Adverse Outcomes": float(pos_pred[0][1]), "No Adverse Outcomes": float(pos_pred[0][0])}
#Define interpret for y1/AE.
def y1_interpret_xgb(*args):
df = pd.DataFrame([args], columns=x.columns)
df = df.astype({col: "category" for col in categorical_columns})
shap_values = y1_explainer_xgb.shap_values(xgb.DMatrix(df, enable_categorical=True))
scores_desc = list(zip(shap_values[0], x.columns))
scores_desc = sorted(scores_desc)
fig_m = plt.figure(facecolor='white')
fig_m.set_size_inches(14, 10)
plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
plt.yticks(fontsize=12)
plt.xlabel("Shap Value", fontsize = 16, labelpad=8, fontweight = 'bold')
plt.ylabel("Feature", fontsize = 16, labelpad=14, fontweight = 'bold')
return fig_m
def y1_interpret_lgb(*args):
df = pd.DataFrame([args], columns=x.columns)
df = df.astype({col: "category" for col in categorical_columns})
shap_values = y1_explainer_lgb.shap_values(df)
scores_desc = list(zip(shap_values[0][0], x.columns))
scores_desc = sorted(scores_desc)
fig_m = plt.figure(facecolor='white')
fig_m.set_size_inches(14, 10)
plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
plt.yticks(fontsize=12)
plt.xlabel("Shap Value", fontsize = 16, labelpad=8, fontweight = 'bold')
plt.ylabel("Feature", fontsize = 16, labelpad=14, fontweight = 'bold')
return fig_m
def y1_interpret_cb(*args):
df = pd.DataFrame([args], columns=x.columns)
df = df.astype({col: "category" for col in categorical_columns})
shap_values = y1_explainer_cb.shap_values(Pool(df, cat_features = categorical_columns))
scores_desc = list(zip(shap_values[0], x.columns))
scores_desc = sorted(scores_desc)
fig_m = plt.figure(facecolor='white')
fig_m.set_size_inches(14, 10)
plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
plt.yticks(fontsize=12)
plt.xlabel("Shap Value", fontsize = 16, labelpad=8, fontweight = 'bold')
plt.ylabel("Feature", fontsize = 16, labelpad=14, fontweight = 'bold')
return fig_m
def y1_interpret_rf(*args):
df = pd.DataFrame([args], columns=x_rf.columns)
df = df.astype({col: "category" for col in categorical_columns})
shap_values = y1_explainer_rf.shap_values(df)
scores_desc = list(zip(shap_values[0][0], x_rf.columns))
scores_desc = sorted(scores_desc)
fig_m = plt.figure(facecolor='white')
fig_m.set_size_inches(14, 10)
plt.barh([s[1] for s in scores_desc], [s[0] for s in scores_desc])
plt.title("Feature Shap Values", fontsize = 24, pad = 20, fontweight = 'bold')
plt.yticks(fontsize=12)
plt.xlabel("Shap Value", fontsize = 16, labelpad=8, fontweight = 'bold')
plt.ylabel("Feature", fontsize = 16, labelpad=14, fontweight = 'bold')
return fig_m
with gr.Blocks(title = "NSQIP-CDA") as demo:
gr.Markdown(
"""
<br/>
<center><h2>NOT FOR CLINICAL USE</h2><center>
<br/>
<center><h1>Cervical Disc Arthroplasty Outcomes</h1></center>
<center><h2>Prediction Tool</h2></center>
<br/>
<center><h3>This web application should not be used to guide any clinical decisions.</h3><center>
<br/>
<center><i>The publication describing the details of this prediction tool can be reached from https://doi.org/10.1016/j.wneu.2023.06.025.</i><center>
"""
)
with gr.Row():
with gr.Column():
AGE = gr.Slider(label="Age", minimum=17, maximum=99, step=1, randomize=True)
SEX = gr.Radio(
label="Sex",
choices=unique_sex,
type='index',
value=lambda: random.choice(unique_sex),
)
RACE = gr.Radio(
label="Race",
choices=unique_race,
type='index',
value=lambda: random.choice(unique_race),
)
HEIGHT = gr.Slider(label="Height (in meters)", minimum=1.0, maximum=2.25, step=0.01, randomize=True)
WEIGHT = gr.Slider(label="Weight (in kilograms)", minimum=20, maximum=200, step=1, randomize=True)
BMI = gr.Slider(label="BMI", minimum=10, maximum=70, step=1, randomize=True)
TRANST = gr.Radio(
label="Transfer Status",
choices=unique_transt,
type='index',
value=lambda: random.choice(unique_transt),
)
SURGSPEC = gr.Radio(
label="Surgical Specialty",
choices=unique_surgspec,
type='index',
value=lambda: random.choice(unique_surgspec),
)
SMOKE = gr.Radio(
label="Smoking Status",
choices=unique_smoke,
type='index',
value=lambda: random.choice(unique_smoke),
)
DIABETES = gr.Radio(
label="Diabetes",
choices=unique_diabetes,
type='index',
value=lambda: random.choice(unique_diabetes),
)
DYSPNEA = gr.Radio(
label="Dyspnea",
choices=unique_dyspnea,
type='index',
value=lambda: random.choice(unique_dyspnea),
)
VENTILAT = gr.Radio(
label="Ventilator Dependency",
choices=unique_ventilat,
type='index',
value=lambda: random.choice(unique_ventilat),
)
HXCOPD = gr.Radio(
label="History of COPD",
choices=unique_hxcopd,
type='index',
value=lambda: random.choice(unique_hxcopd),
)
ASCITES = gr.Radio(
label="Ascites",
choices=unique_ascites,
type='index',
value=lambda: random.choice(unique_ascites),
)
HXCHF = gr.Radio(
label="History of Congestive Heart Failure",
choices=unique_hxchf,
type='index',
value=lambda: random.choice(unique_hxchf),
)
HYPERMED = gr.Radio(
label="Hypertension Despite Medication",
choices=unique_hypermed,
type='index',
value=lambda: random.choice(unique_hypermed),
)
RENAFAIL = gr.Radio(
label="Renal Failure",
choices=unique_renafail,
type='index',
value=lambda: random.choice(unique_renafail),
)
DIALYSIS = gr.Radio(
label="Dialysis",
choices=unique_dialysis,
type='index',
value=lambda: random.choice(unique_dialysis),
)
STEROID = gr.Radio(
label="Steroid",
choices=unique_steroid,
type='index',
value=lambda: random.choice(unique_steroid),
)
WTLOSS = gr.Radio(
label="Weight Loss",
choices=unique_wtloss,
type='index',
value=lambda: random.choice(unique_wtloss),
)
BLEEDDIS = gr.Radio(
label="Bleeding Disorder",
choices=unique_bleeddis,
type='index',
value=lambda: random.choice(unique_bleeddis),
)
TRANSFUS = gr.Radio(
label="Transfusion",
choices=unique_transfus,
type='index',
value=lambda: random.choice(unique_transfus),
)
WNDINF = gr.Radio(
label="Wound Infection",
choices=unique_wndinf,
type='index',
value=lambda: random.choice(unique_wndinf),
)
DISCANCR = gr.Radio(
label="Disseminated Cancer",
choices=unique_discancr,
type='index',
value=lambda: random.choice(unique_discancr),
)
FNSTATUS2 = gr.Radio(
label="Functional Status",
choices=unique_fnstatus2,
type='index',
value=lambda: random.choice(unique_fnstatus2),
)
PRSODM = gr.Slider(label="Sodium", minimum=min(x['PRSODM']), maximum=max(x['PRSODM']), step=1, randomize=True)
PRBUN = gr.Slider(label="BUN", minimum=min(x['PRBUN']), maximum=max(x['PRBUN']), step=1, randomize=True)
PRCREAT = gr.Slider(label="Creatine", minimum=min(x['PRCREAT']),maximum=max(x['PRCREAT']), step=0.1, randomize=True)
PRWBC = gr.Slider(label="WBC", minimum=min(x['PRWBC']), maximum=max(x['PRWBC']), step=0.1, randomize=True)
PRHCT = gr.Slider(label="Hematocrit", minimum=min(x['PRHCT']), maximum=max(x['PRHCT']), step=0.1, randomize=True)
PRPLATE = gr.Slider(label="Platelet", minimum=min(x['PRPLATE']), maximum=max(x['PRPLATE']), step=1, randomize=True)
ASACLAS = gr.Radio(
label="ASA Class",
choices=unique_asaclas,
type='index',
value=lambda: random.choice(unique_asaclas),
)
LEVELS = gr.Radio(
label="Levels",
choices=unique_levels,
type='index',
value=lambda: random.choice(unique_levels),
)
with gr.Column():
with gr.Row():
y1_predict_btn_xgb = gr.Button(value="Predict (XGBoost)")
y1_predict_btn_lgb = gr.Button(value="Predict (LightGBM)")
y1_predict_btn_cb = gr.Button(value="Predict (CatBoost)")
y1_predict_btn_rf = gr.Button(value="Predict (Random Forest)")
label = gr.Label()
with gr.Row():
y1_interpret_btn_xgb = gr.Button(value="Explain (XGBoost)")
y1_interpret_btn_lgb = gr.Button(value="Explain (LightGBM)")
y1_interpret_btn_cb = gr.Button(value="Explain (CatBoost)")
y1_interpret_btn_rf = gr.Button(value="Explain (Random Forest)")
plot = gr.Plot()
y1_predict_btn_xgb.click(
y1_predict_xgb,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[label]
)
y1_predict_btn_lgb.click(
y1_predict_lgb,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[label]
)
y1_predict_btn_cb.click(
y1_predict_cb,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[label]
)
y1_predict_btn_rf.click(
y1_predict_rf,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[label]
)
y1_interpret_btn_xgb.click(
y1_interpret_xgb,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[plot],
)
y1_interpret_btn_lgb.click(
y1_interpret_lgb,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[plot],
)
y1_interpret_btn_cb.click(
y1_interpret_cb,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[plot],
)
y1_interpret_btn_rf.click(
y1_interpret_rf,
inputs=[SEX, TRANST, AGE, SURGSPEC, HEIGHT, WEIGHT, DIABETES, SMOKE, DYSPNEA, FNSTATUS2, VENTILAT, HXCOPD, ASCITES, HXCHF, HYPERMED, RENAFAIL, DIALYSIS, DISCANCR, WNDINF, STEROID, WTLOSS, BLEEDDIS, TRANSFUS, PRSODM, PRBUN, PRCREAT, PRWBC, PRHCT, PRPLATE, ASACLAS, BMI, RACE, LEVELS,],
outputs=[plot],
)
gr.Markdown(
"""
<center><h2>Disclaimer</h2>
<center>
The American College of Surgeons National Surgical Quality Improvement Program and the hospitals participating in the ACS NSQIP are the source of the data used herein; they have not been verified and are not responsible for the statistical validity of the data analysis or the conclusions derived by the authors. The predictive tool located on this web page is for healthcare professionals' use only. This prediction tool should not be used in place of professional medical service for any disease or concern. Users of the prediction tool shouldn't base their decisions about their own health issues on the information presented here. You should ask any questions to your own doctor or another healthcare professional. The authors of the study mentioned above make no guarantees or representations, either express or implied, as to the completeness, timeliness, comparative or contentious nature, or utility of any information contained in or referred to in this prediction tool. The risk associated with using this prediction tool or the information in this predictive tool is not at all assumed by the authors. The information contained in the prediction tools may be outdated, not complete, or incorrect because health-related information is subject to frequent change and multiple confounders. No express or implied doctor-patient relationship is established by using the prediction tool. The prediction tools on this website are not validated by the authors. Users of the tool are not contacted by the authors, who also do not record any specific information about them. You are hereby advised to seek the advice of a doctor or other qualified healthcare provider before making any decisions, acting, or refraining from acting in response to any healthcare problem or issue you may be experiencing at any time, now or in the future. By using the prediction tool, you acknowledge and agree that neither the authors nor any other party are or will be liable or otherwise responsible for any decisions you make, actions you take, or actions you choose not to take as a result of using any information presented here.
<br/>
<h4>By using this tool, you accept all of the above terms.<h4/>
</center>
"""
)
demo.launch() |