File size: 582 Bytes
e1fe808
 
5ec1633
e1fe808
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import joblib
import sklearn
our_trained_model =joblib.load("our_model.sav")

def greet(preg, plas, pres, skin, test, mass, pedi, age):

  result = our_trained_model.predict([[int(preg), int(plas), int(pres), int(skin), int(test), int(mass), int(pedi), int(age)]])

  var = int(result[0])
  if var == 0:
    result = "Negative"
  else:
    result = "Positive"

  return "Is the Patient Diabetic:  " + str(result)

demo = gr.Interface(
    fn=greet,
    inputs=["text", "text","text", "text","text", "text","text", "text"],
    outputs=["text"],
)

demo.launch()