-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPredict.py
58 lines (24 loc) · 959 Bytes
/
Predict.py
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
import numpy as np
import pickle
import streamlit as st
st.title(' DIABETES PREDICTION ')
loaded_model = pickle.load(open('Diabetesmodel.pkl', 'rb'))
def Disease(input_data):
input_data_as_numpy_array = np.asarray(input_data)
input_reshape = input_data_as_numpy_array.reshape(1, -1)
prediction = loaded_model.predict(input_reshape)
if(prediction[0]==0):
return st.success(' The Person May Not Have Diabetes')
else:
return st.error(' The Person May Has Diabetes')
def main():
st.write("Prediction Model")
BMI = st.number_input("Enter Body Mass Index ")
Insulin = st.number_input("Enter Insulin ", step = 2)
Glucose = st.number_input("Enter Glucose ", step = 2)
Age = st.number_input("Enter Your Age ", step = 2)
diagnosis = ''
if st.button('PREDICT'):
diagnosis = Disease([Glucose,Insulin,BMI,Age])
if __name__ == '__main__':
main()