Spaces:
Sleeping
Sleeping
File size: 773 Bytes
0c60575 | 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 | import gradio as gr
import joblib
model = joblib.load("model.pkl")
def predict(Pregnancies, Glucose, BP, Skin, Insulin, BMI, DPF, Age):
data = [[Pregnancies, Glucose, BP, Skin, Insulin, BMI, DPF, Age]]
result = model.predict(data)[0]
return "Diabetic" if result == 1 else "Not Diabetic"
app = gr.Interface(
fn=predict,
inputs=[
gr.Number(label="Pregnancies"),
gr.Number(label="Glucose"),
gr.Number(label="Blood Pressure"),
gr.Number(label="Skin Thickness"),
gr.Number(label="Insulin"),
gr.Number(label="BMI"),
gr.Number(label="Diabetes Pedigree Function"),
gr.Number(label="Age")
],
outputs="text",
title="Diabetes Prediction App"
)
app.launch()
|