-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsts.py
134 lines (112 loc) · 3.66 KB
/
consts.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
from pyspark.sql import types as t
HEART_COLS = ['age', 'anaemia', 'creatinine_phosphokinase',
'diabetes', 'ejection_fraction',
'high_blood_pressure', 'platelets',
'serum_creatinine', 'serum_sodium',
'sex', 'smoking', 'time', 'DEATH_EVENT']
HEART_TARGET = 'DEATH_EVENT'
HEART_ATTRIBUTES = [heart_attribute for heart_attribute in HEART_COLS if not heart_attribute == HEART_TARGET]
HEART_NAME = 'heart'
HEART_MAPPING = {
'age': t.IntegerType(),
'anaemia': t.ShortType(),
'creatinine_phosphokinase': t.LongType(),
'diabetes': t.ShortType(),
'ejection_fraction': t.IntegerType(),
'high_blood_pressure': t.ShortType(),
'platelets': t.DoubleType(),
'serum_creatinine': t.FloatType(),
'serum_sodium': t.IntegerType(),
'sex': t.ShortType(),
'smoking': t.ShortType(),
'time': t.IntegerType(),
'DEATH_EVENT': t.ShortType()
}
COVID_ALL_COLS = [
"USMER", "MEDICAL_UNIT", "SEX", "PATIENT_TYPE", "DATE_DIED",
"INTUBED", "PNEUMONIA", "AGE", "PREGNANT", "DIABETES",
"COPD", "ASTHMA", "INMSUPR", "HIPERTENSION", "OTHER_DISEASE",
"CARDIOVASCULAR", "OBESITY", "RENAL_CHRONIC", "TOBACCO",
"CLASIFFICATION_FINAL", "ICU"
]
COVID_FEATURE_COLS = [col for col in COVID_ALL_COLS if col != 'CLASIFFICATION_FINAL']
COVID_TARGET = 'CLASIFFICATION_FINAL'
COVID_TARGET_INDEX = -2
COVID_MAPPING = {
"SEX": t.IntegerType(),
"AGE": t.IntegerType(),
"CLASIFFICATION_FINAL": t.IntegerType(),
"PATIENT_TYPE": t.IntegerType(),
"PNEUMONIA": t.IntegerType(),
"PREGNANT": t.IntegerType(),
"DIABETES": t.IntegerType(),
"COPD": t.IntegerType(),
"ASTHMA": t.IntegerType(),
"INMSUPR": t.IntegerType(),
"HIPERTENSION": t.IntegerType(),
"CARDIOVASCULAR": t.IntegerType(),
"RENAL_CHRONIC": t.IntegerType(),
"OTHER_DISEASE": t.IntegerType(),
"OBESITY": t.IntegerType(),
"TOBACCO": t.IntegerType(),
"USMER": t.IntegerType(),
"MEDICAL_UNIT": t.IntegerType(),
"INTUBED": t.IntegerType(),
"ICU": t.IntegerType(),
"DATE_DIED": t.DateType()
}
TITANIC_ALL_COLS = [
'PassengerId',
'HomePlanet',
'CryoSleep',
'Cabin',
'Destination',
'Age',
'VIP',
'RoomService',
'FoodCourt',
'ShoppingMall',
'Spa',
'VRDeck',
'Name',
'Transported'
]
TITANIC_FEATURES = [col for col in TITANIC_ALL_COLS if col != 'Transported']
TITANIC_MAPPING = {
'PassengerId': t.StringType(),
'HomePlanet': t.StringType(),
'CryoSleep': t.StringType(),
'Cabin': t.StringType(),
'Destination': t.StringType(),
'Age': t.FloatType(),
'VIP': t.StringType(),
'RoomService': t.FloatType(),
'FoodCourt': t.FloatType(),
'ShoppingMall': t.FloatType(),
'Spa': t.FloatType(),
'VRDeck': t.FloatType(),
'Name': t.StringType(),
'Transported': t.StringType()
}
TITANIC_TARGET = 'Transported'
TITANIC_TARGET_INDEX = -1
TITANIC_CAT_COLUMNS = ['PassengerId', 'HomePlanet', 'CryoSleep',
'Cabin', 'VIP', 'Destination', 'Name', 'Transported']
TITANIC_MEDIAN_COLS = ['Age', 'RoomService', 'FoodCourt', 'ShoppingMall',
'Spa', 'VRDeck']
TITANIC_FEATURE_COLS = ['Age', 'RoomService', 'FoodCourt', 'ShoppingMall',
'Spa', 'VRDeck']
TITANIC_MEAN_COLS = []
TITANIC_NULL_COLUMNS = ['HomePlanet', 'CryoSleep', 'Cabin', 'VIP', 'Destination', 'Name']
COVID_DATE_FORMAT = 'dd/MM/yyyy'
FEATURES_NAME = 'features'
CORRELATION_THRESHOLD = .5
class Columns:
date_died = 'DATE_DIED'
classification_final = 'CLASIFFICATION_FINAL'
died = 'DIED'
passenger_id = 'PassengerId'
name = 'Name'
cabin = 'Cabin'
deck = 'Deck'
columns = Columns()