Akshaybayern commited on
Commit
47fbd2d
1 Parent(s): baab521

Upload 5 files

Browse files
diabetes_model.sav ADDED
Binary file (27.9 kB). View file
 
heart_disease_model.sav ADDED
Binary file (1.21 kB). View file
 
mdps_public.py ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created on Sun May 8 21:01:15 2022
4
+
5
+ @author: siddhardhan
6
+ """
7
+
8
+ import pickle
9
+ import streamlit as st
10
+ from streamlit_option_menu import option_menu
11
+
12
+
13
+ # loading the saved models
14
+
15
+ diabetes_model = pickle.load(open('diabetes_model.sav', 'rb'))
16
+
17
+ heart_disease_model = pickle.load(open('heart_disease_model.sav', 'rb'))
18
+
19
+ parkinsons_model = pickle.load(open('parkinsons_model.sav', 'rb'))
20
+
21
+
22
+
23
+ # sidebar for navigation
24
+ with st.sidebar:
25
+
26
+ selected = option_menu('Multiple Disease Prediction System',
27
+
28
+ ['Diabetes Prediction',
29
+ 'Heart Disease Prediction',
30
+ 'Parkinsons Prediction'],
31
+ icons=['activity','heart','person'],
32
+ default_index=0)
33
+
34
+
35
+ # Diabetes Prediction Page
36
+ if (selected == 'Diabetes Prediction'):
37
+
38
+ # page title
39
+ st.title('Diabetes Prediction using ML')
40
+
41
+
42
+ # getting the input data from the user
43
+ col1, col2, col3 = st.columns(3)
44
+
45
+ with col1:
46
+ Pregnancies = st.text_input('Number of Pregnancies')
47
+
48
+ with col2:
49
+ Glucose = st.text_input('Glucose Level')
50
+
51
+ with col3:
52
+ BloodPressure = st.text_input('Blood Pressure value')
53
+
54
+ with col1:
55
+ SkinThickness = st.text_input('Skin Thickness value')
56
+
57
+ with col2:
58
+ Insulin = st.text_input('Insulin Level')
59
+
60
+ with col3:
61
+ BMI = st.text_input('BMI value')
62
+
63
+ with col1:
64
+ DiabetesPedigreeFunction = st.text_input('Diabetes Pedigree Function value')
65
+
66
+ with col2:
67
+ Age = st.text_input('Age of the Person')
68
+
69
+
70
+ # code for Prediction
71
+ diab_diagnosis = ''
72
+
73
+ # creating a button for Prediction
74
+
75
+ if st.button('Diabetes Test Result'):
76
+ diab_prediction = diabetes_model.predict([[Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, Age]])
77
+
78
+ if (diab_prediction[0] == 1):
79
+ diab_diagnosis = 'The person is diabetic'
80
+ else:
81
+ diab_diagnosis = 'The person is not diabetic'
82
+
83
+ st.success(diab_diagnosis)
84
+
85
+
86
+
87
+
88
+ # Heart Disease Prediction Page
89
+ if (selected == 'Heart Disease Prediction'):
90
+
91
+ # page title
92
+ st.title('Heart Disease Prediction using ML')
93
+
94
+ col1, col2, col3 = st.columns(3)
95
+
96
+ with col1:
97
+ age = st.text_input('Age')
98
+
99
+ with col2:
100
+ sex = st.text_input('Sex')
101
+
102
+ with col3:
103
+ cp = st.text_input('Chest Pain types')
104
+
105
+ with col1:
106
+ trestbps = st.text_input('Resting Blood Pressure')
107
+
108
+ with col2:
109
+ chol = st.text_input('Serum Cholestoral in mg/dl')
110
+
111
+ with col3:
112
+ fbs = st.text_input('Fasting Blood Sugar > 120 mg/dl')
113
+
114
+ with col1:
115
+ restecg = st.text_input('Resting Electrocardiographic results')
116
+
117
+ with col2:
118
+ thalach = st.text_input('Maximum Heart Rate achieved')
119
+
120
+ with col3:
121
+ exang = st.text_input('Exercise Induced Angina')
122
+
123
+ with col1:
124
+ oldpeak = st.text_input('ST depression induced by exercise')
125
+
126
+ with col2:
127
+ slope = st.text_input('Slope of the peak exercise ST segment')
128
+
129
+ with col3:
130
+ ca = st.text_input('Major vessels colored by flourosopy')
131
+
132
+ with col1:
133
+ thal = st.text_input('thal: 0 = normal; 1 = fixed defect; 2 = reversable defect')
134
+
135
+
136
+
137
+
138
+ # code for Prediction
139
+ heart_diagnosis = ''
140
+
141
+ # creating a button for Prediction
142
+
143
+ if st.button('Heart Disease Test Result'):
144
+ heart_prediction = heart_disease_model.predict([[age, sex, cp, trestbps, chol, fbs, restecg,thalach,exang,oldpeak,slope,ca,thal]])
145
+
146
+ if (heart_prediction[0] == 1):
147
+ heart_diagnosis = 'The person is having heart disease'
148
+ else:
149
+ heart_diagnosis = 'The person does not have any heart disease'
150
+
151
+ st.success(heart_diagnosis)
152
+
153
+
154
+
155
+
156
+ # Parkinson's Prediction Page
157
+ if (selected == "Parkinsons Prediction"):
158
+
159
+ # page title
160
+ st.title("Parkinson's Disease Prediction using ML")
161
+
162
+ col1, col2, col3, col4, col5 = st.columns(5)
163
+
164
+ with col1:
165
+ fo = st.text_input('MDVP:Fo(Hz)')
166
+
167
+ with col2:
168
+ fhi = st.text_input('MDVP:Fhi(Hz)')
169
+
170
+ with col3:
171
+ flo = st.text_input('MDVP:Flo(Hz)')
172
+
173
+ with col4:
174
+ Jitter_percent = st.text_input('MDVP:Jitter(%)')
175
+
176
+ with col5:
177
+ Jitter_Abs = st.text_input('MDVP:Jitter(Abs)')
178
+
179
+ with col1:
180
+ RAP = st.text_input('MDVP:RAP')
181
+
182
+ with col2:
183
+ PPQ = st.text_input('MDVP:PPQ')
184
+
185
+ with col3:
186
+ DDP = st.text_input('Jitter:DDP')
187
+
188
+ with col4:
189
+ Shimmer = st.text_input('MDVP:Shimmer')
190
+
191
+ with col5:
192
+ Shimmer_dB = st.text_input('MDVP:Shimmer(dB)')
193
+
194
+ with col1:
195
+ APQ3 = st.text_input('Shimmer:APQ3')
196
+
197
+ with col2:
198
+ APQ5 = st.text_input('Shimmer:APQ5')
199
+
200
+ with col3:
201
+ APQ = st.text_input('MDVP:APQ')
202
+
203
+ with col4:
204
+ DDA = st.text_input('Shimmer:DDA')
205
+
206
+ with col5:
207
+ NHR = st.text_input('NHR')
208
+
209
+ with col1:
210
+ HNR = st.text_input('HNR')
211
+
212
+ with col2:
213
+ RPDE = st.text_input('RPDE')
214
+
215
+ with col3:
216
+ DFA = st.text_input('DFA')
217
+
218
+ with col4:
219
+ spread1 = st.text_input('spread1')
220
+
221
+ with col5:
222
+ spread2 = st.text_input('spread2')
223
+
224
+ with col1:
225
+ D2 = st.text_input('D2')
226
+
227
+ with col2:
228
+ PPE = st.text_input('PPE')
229
+
230
+
231
+
232
+ # code for Prediction
233
+ parkinsons_diagnosis = ''
234
+
235
+ # creating a button for Prediction
236
+ if st.button("Parkinson's Test Result"):
237
+ parkinsons_prediction = parkinsons_model.predict([[fo, fhi, flo, Jitter_percent, Jitter_Abs, RAP, PPQ,DDP,Shimmer,Shimmer_dB,APQ3,APQ5,APQ,DDA,NHR,HNR,RPDE,DFA,spread1,spread2,D2,PPE]])
238
+
239
+ if (parkinsons_prediction[0] == 1):
240
+ parkinsons_diagnosis = "The person has Parkinson's disease"
241
+ else:
242
+ parkinsons_diagnosis = "The person does not have Parkinson's disease"
243
+
244
+ st.success(parkinsons_diagnosis)
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
parkinsons_model.sav ADDED
Binary file (12.7 kB). View file
 
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ numpy==1.21.4
2
+ pickle-mixin==1.0.2
3
+ streamlit==1.2.0
4
+ streamlit-option-menu==0.3.2
5
+ scikit-learn==1.0.1