-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDTEMP1.py
53 lines (36 loc) · 1 KB
/
DTEMP1.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
#!/usr/bin/env python
# coding: utf-8
# In[16]:
import pandas as pd
import numpy as np
from keras import models
from keras.models import load_model
from tensorflow import keras
# In[17]:
model = keras.models.load_model('www')
# In[30]:
def pred(age,fpg,diabp,sysbp,bmi,avgsugar,wcir,hcir,chol,ogtt):
mean=np.array([ 47.57372401, 152.46691871, 80.99243856, 130.42627599,
25.15104344, 7.84291115, 95.4073724 , 98.72117202,
237.63610586, 217.36672968])
dev=np.array([13.949183 , 73.80475753, 4.83384664, 12.72021721, 3.98544049,
2.3917692 , 11.75528716, 10.05522809, 50.12737702, 91.57451541])
x=np.zeros(10)
x[0]=age
x[1]=fpg
x[2]=diabp
x[3]=sysbp
x[4]=bmi
x[5]=avgsugar
x[6]=wcir
x[7]=hcir
x[8]=chol
x[9]=ogtt
for i in range(0,10):
x[i]=(x[i]-mean[i])/dev[i]
x=x.reshape((1,10,-1))
out= model.predict([x])
if(out[0][0]>0.5):
return 'Diabetic'
else:
return 'Non-Diabetic'