-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiabetes_Detector.py
46 lines (33 loc) · 1.02 KB
/
Diabetes_Detector.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
from learn import *
import os
import warnings
warnings.filterwarnings("ignore", category=UserWarning)
def clear_screen():
os.system('cls')
while True :
print("-----------------Diabetes-Detector----------------\n\n")
age = input("Age : ")
insulin = input("Insulin level : ")
bp = input("Blood Preasure : ")
bmi = input("Body Mass Index (BMI) : ")
dpf = input("DPF : ")
glucose = input("Glucose level : ")
st = input("Skin Thickness : ")
preg = input("Number of childrens : ")
new_info = (preg,glucose,bp,st,insulin,bmi,dpf,age)
info_arr = np.asarray(new_info)
update_arr = info_arr.reshape(1,-1)
final_data = scaler.transform(update_arr)
result = myML.predict(final_data)
if result[0] == 1:
print('DIABETICS DETECTED !!!')
else:
print('DIABETICS NOT DETECTED !!!')
print("test again : Y/N")
key = input()
if key == 'Y':
clear_screen()
elif key == 'N':
clear_screen()
input('Press any key to close')
break