Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +6 -5
Mimic4Dataset.py
CHANGED
|
@@ -214,21 +214,22 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
| 214 |
|
| 215 |
|
| 216 |
def verif_dim_tensor(self, proc, out, chart, meds, lab):
|
|
|
|
| 217 |
verif=True
|
| 218 |
if self.feat_proc:
|
| 219 |
-
if (len(proc)!=
|
| 220 |
verif=False
|
| 221 |
if self.feat_out:
|
| 222 |
-
if (len(out)!=
|
| 223 |
verif=False
|
| 224 |
if self.feat_chart:
|
| 225 |
-
if (len(chart)!=
|
| 226 |
verif=False
|
| 227 |
if self.feat_meds:
|
| 228 |
-
if (len(meds)!=
|
| 229 |
verif=False
|
| 230 |
if self.feat_lab:
|
| 231 |
-
if (len(lab)!=
|
| 232 |
verif=False
|
| 233 |
return verif
|
| 234 |
|
|
|
|
| 214 |
|
| 215 |
|
| 216 |
def verif_dim_tensor(self, proc, out, chart, meds, lab):
|
| 217 |
+
interv = ((self.timeW + self.predW)//self.bucket) + (self.config.name != 'Mortality')
|
| 218 |
verif=True
|
| 219 |
if self.feat_proc:
|
| 220 |
+
if (len(proc)!= interv):
|
| 221 |
verif=False
|
| 222 |
if self.feat_out:
|
| 223 |
+
if (len(out)!=interv):
|
| 224 |
verif=False
|
| 225 |
if self.feat_chart:
|
| 226 |
+
if (len(chart)!=interv):
|
| 227 |
verif=False
|
| 228 |
if self.feat_meds:
|
| 229 |
+
if (len(meds)!=interv):
|
| 230 |
verif=False
|
| 231 |
if self.feat_lab:
|
| 232 |
+
if (len(lab)!=interv):
|
| 233 |
verif=False
|
| 234 |
return verif
|
| 235 |
|