Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +9 -7
Mimic4Dataset.py
CHANGED
@@ -77,10 +77,10 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
77 |
"age": datasets.Value("int32"),
|
78 |
"COND": datasets.Sequence(datasets.Value("string")),
|
79 |
|
80 |
-
"PROC":
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
"CHART": datasets.Sequence(
|
85 |
{
|
86 |
"signal" : datasets.Sequence(
|
@@ -133,15 +133,17 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
133 |
age = data['age']
|
134 |
gender = data['gender']
|
135 |
label = data['label']
|
136 |
-
|
137 |
-
|
|
|
|
|
138 |
|
139 |
|
140 |
yield hid, {
|
141 |
"gender" : gender,
|
142 |
"ethnicity" : eth,
|
143 |
"age" : age,
|
144 |
-
"PROC" :
|
145 |
"CHART" : None,
|
146 |
"OUT" : None,
|
147 |
"COND" : cond_features,
|
|
|
77 |
"age": datasets.Value("int32"),
|
78 |
"COND": datasets.Sequence(datasets.Value("string")),
|
79 |
|
80 |
+
"PROC": {
|
81 |
+
"id": datasets.Sequence(datasets.Value("int32")),
|
82 |
+
"value": datasets.Sequence(datasets.Value("float32"))
|
83 |
+
}),
|
84 |
"CHART": datasets.Sequence(
|
85 |
{
|
86 |
"signal" : datasets.Sequence(
|
|
|
133 |
age = data['age']
|
134 |
gender = data['gender']
|
135 |
label = data['label']
|
136 |
+
items = list(proc_features.keys())
|
137 |
+
values =[proc_features[i] for i in items ]
|
138 |
+
procs = {"id" : id,
|
139 |
+
"value": values}
|
140 |
|
141 |
|
142 |
yield hid, {
|
143 |
"gender" : gender,
|
144 |
"ethnicity" : eth,
|
145 |
"age" : age,
|
146 |
+
"PROC" : procs,
|
147 |
"CHART" : None,
|
148 |
"OUT" : None,
|
149 |
"COND" : cond_features,
|