Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
def predict_death_event(age, anaemia, creatinine_phosphokinase ,diabetes ,ejection_fraction, high_blood_pressure ,platelets ,serum_creatinine, serum_sodium, sex ,smoking ,time):
|
| 5 |
input=[[age, anaemia, creatinine_phosphokinase ,diabetes ,ejection_fraction, high_blood_pressure ,platelets ,serum_creatinine, serum_sodium, sex ,smoking ,time]]
|
| 6 |
result=loaded_model.predict(input)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import pickle
|
| 3 |
+
import numpy as np
|
| 4 |
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
save_file_name="xgboost-model.pkl"
|
| 8 |
+
loaded_model = pickle.load(open(save_file_name, 'rb'))
|
| 9 |
def predict_death_event(age, anaemia, creatinine_phosphokinase ,diabetes ,ejection_fraction, high_blood_pressure ,platelets ,serum_creatinine, serum_sodium, sex ,smoking ,time):
|
| 10 |
input=[[age, anaemia, creatinine_phosphokinase ,diabetes ,ejection_fraction, high_blood_pressure ,platelets ,serum_creatinine, serum_sodium, sex ,smoking ,time]]
|
| 11 |
result=loaded_model.predict(input)
|