-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinference.py
71 lines (68 loc) · 4.17 KB
/
inference.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import fuzzification
def inference(age, blood_pressure, blood_sugar, cholesterol, maximum_heart_rate, ECG, oldPeak, chest_pain,
sex, thallium, exercise):
sick_1 = []
sick_2 = []
sick_3 = []
sick_4 = []
healthy = []
sick_4.append(min(fuzzification.age_mem(age)[3], fuzzification.chestPain_mem(chest_pain)[1]))
sick_4.append(min(fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[2], fuzzification.age_mem(age)[2]))
sick_3.append(min(fuzzification.sex_mem(sex)[0], fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[1]))
sick_2.append(min(fuzzification.sex_mem(sex)[1], fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[1]))
sick_3.append(min(fuzzification.chestPain_mem(chest_pain)[2], fuzzification.blood_pres_mem(blood_pressure)[2]))
sick_2.append(min(fuzzification.chestPain_mem(chest_pain)[0], fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[1]))
sick_3.append(min(fuzzification.blood_sugar_mem(blood_sugar)[0], fuzzification.age_mem(age)[1]))
sick_2.append(min(fuzzification.blood_sugar_mem(blood_sugar)[0], fuzzification.blood_pres_mem(blood_pressure)[3]))
sick_1.append(max(fuzzification.chestPain_mem(chest_pain)[3], fuzzification.age_mem(age)[3]))
sick_1.append(max(fuzzification.blood_pres_mem(blood_pressure)[2], fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[0]))
healthy.append(fuzzification.chestPain_mem(chest_pain)[0])
sick_1.append(fuzzification.chestPain_mem(chest_pain)[1])
sick_2.append(fuzzification.chestPain_mem(chest_pain)[2])
sick_3.append(fuzzification.chestPain_mem(chest_pain)[3])
sick_4.append(fuzzification.chestPain_mem(chest_pain)[3])
sick_1.append(fuzzification.sex_mem(sex)[1])
sick_2.append(fuzzification.sex_mem(sex)[0])
healthy.append(fuzzification.blood_pres_mem(blood_pressure)[0])
sick_1.append(fuzzification.blood_pres_mem(blood_pressure)[1])
sick_2.append(fuzzification.blood_pres_mem(blood_pressure)[2])
sick_3.append(fuzzification.blood_pres_mem(blood_pressure)[2])
sick_4.append(fuzzification.blood_pres_mem(blood_pressure)[3])
healthy.append(fuzzification.cholesterol_mem(cholesterol)[0])
sick_1.append(fuzzification.cholesterol_mem(cholesterol)[1])
sick_2.append(fuzzification.cholesterol_mem(cholesterol)[2])
sick_3.append(fuzzification.cholesterol_mem(cholesterol)[2])
sick_4.append(fuzzification.cholesterol_mem(cholesterol)[3])
sick_2.append(fuzzification.blood_sugar_mem(blood_sugar)[0])
healthy.append(fuzzification.ecg_mem(ECG)[0])
sick_1.append(fuzzification.ecg_mem(ECG)[0])
sick_2.append(fuzzification.ecg_mem(ECG)[1])
sick_3.append(fuzzification.ecg_mem(ECG)[2])
sick_4.append(fuzzification.ecg_mem(ECG)[2])
healthy.append(fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[0])
sick_1.append(fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[1])
sick_2.append(fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[1])
sick_3.append(fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[2])
sick_4.append(fuzzification.maximum_heart_rate_mem(maximum_heart_rate)[2])
sick_2.append(fuzzification.exercise_mem(exercise)[1])
healthy.append(fuzzification.oldpeak_mem(oldPeak)[0])
sick_1.append(fuzzification.oldpeak_mem(oldPeak)[0])
sick_2.append(fuzzification.oldpeak_mem(oldPeak)[2])
sick_3.append(fuzzification.oldpeak_mem(oldPeak)[2])
sick_4.append(fuzzification.oldpeak_mem(oldPeak)[1])
healthy.append(fuzzification.thallium_mem(thallium)[0])
sick_1.append(fuzzification.thallium_mem(thallium)[0])
sick_2.append(fuzzification.thallium_mem(thallium)[1])
sick_3.append(fuzzification.thallium_mem(thallium)[2])
sick_4.append(fuzzification.thallium_mem(thallium)[2])
healthy.append(fuzzification.age_mem(age)[0])
sick_1.append(fuzzification.age_mem(age)[1])
sick_2.append(fuzzification.age_mem(age)[2])
sick_3.append(fuzzification.age_mem(age)[2])
sick_4.append(fuzzification.age_mem(age)[3])
sick1_mem = max(sick_1)
sick2_mem = max(sick_2)
sick3_mem = max(sick_3)
sick4_mem = max(sick_4)
healthy_mem = max(healthy)
return sick1_mem, sick2_mem, sick3_mem, sick4_mem, healthy_mem