CoolFace
Apppublic

AUM/CKD

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
app.py35 linesDownload Raw Back to root
1import gradio as gr2import pickle3 4def predict(sg,al,sc,hemo,rc):5 6    with open('model_rf_sg_al_sc_hemo_rc_1.0_6.pkl', 'rb') as f:7      loaded_model = pickle.load(f)8    values =[]9 10    values.append(float(sg))11    values.append(float(al))12    values.append(float(sc))13    values.append(float(hemo))14    values.append(float(rc))15 16 17    18    final_result=loaded_model.predict([values])19    if final_result :20        return "Positive"21    else:22        return "Negative"23 24iface = gr.Interface(predict,25        [26        gr.Textbox(label="Specific Gravity" ,info="", value="1.02"),27        gr.Textbox(label="Albumin" ,info="0 to 5", value="0"),28        gr.Textbox(label="Serum Creatinine" ,info="mgs/dl", value="1.3"),29        gr.Textbox(label="Hemoglobin" ,info="gms", value="12.6499"),30        gr.Textbox(label="Red Blood Cell Count" ,info="millions/cmm", value="4.8"),31        ]32        , outputs = "text", title = "This App predicts if a user has CKD or not/ Prefilled Data are the Medians")33 34 35iface.launch()