Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +11 -7
Mimic4Dataset.py
CHANGED
@@ -96,12 +96,10 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
96 |
}
|
97 |
),
|
98 |
}),
|
99 |
-
"OUT":
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
}
|
104 |
-
),
|
105 |
"label": datasets.ClassLabel(names=["0", "1"]),
|
106 |
}
|
107 |
)
|
@@ -133,10 +131,16 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
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" : items,
|
139 |
"value": values}
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
|
142 |
yield int(hid), {
|
@@ -145,7 +149,7 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
145 |
"age" : age,
|
146 |
"PROC" : procs,
|
147 |
"CHART" : None,
|
148 |
-
"OUT" :
|
149 |
"COND" : cond_features,
|
150 |
"label" : label
|
151 |
}
|
|
|
96 |
}
|
97 |
),
|
98 |
}),
|
99 |
+
"OUT": {
|
100 |
+
"id": datasets.Sequence(datasets.Value("int32")),
|
101 |
+
"value": datasets.Sequence(datasets.Sequence(datasets.Value("float32")))
|
102 |
+
},
|
|
|
|
|
103 |
"label": datasets.ClassLabel(names=["0", "1"]),
|
104 |
}
|
105 |
)
|
|
|
131 |
age = data['age']
|
132 |
gender = data['gender']
|
133 |
label = data['label']
|
134 |
+
|
135 |
items = list(proc_features.keys())
|
136 |
values =[proc_features[i] for i in items ]
|
137 |
procs = {"id" : items,
|
138 |
"value": values}
|
139 |
+
|
140 |
+
items_outs = list(out_features.keys())
|
141 |
+
values_outs =[out_features[i] for i in items_outs ]
|
142 |
+
outs = {"id" : items_outs,
|
143 |
+
"value": values_outs}
|
144 |
|
145 |
|
146 |
yield int(hid), {
|
|
|
149 |
"age" : age,
|
150 |
"PROC" : procs,
|
151 |
"CHART" : None,
|
152 |
+
"OUT" : outs,
|
153 |
"COND" : cond_features,
|
154 |
"label" : label
|
155 |
}
|