Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +5 -8
Mimic4Dataset.py
CHANGED
@@ -153,11 +153,8 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
153 |
timeW = config['timeWindow']
|
154 |
self.timeW=int(timeW.split()[1])
|
155 |
self.bucket = config['timebucket']
|
156 |
-
|
157 |
-
|
158 |
-
else :
|
159 |
-
self.wind =1
|
160 |
-
print(self.wind)
|
161 |
self.data_icu = config['icu_no_icu']=='ICU'
|
162 |
|
163 |
if self.data_icu:
|
@@ -447,12 +444,12 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
447 |
demo=demo.drop(['label'],axis=1)
|
448 |
X= generate_ml(dyn_df,cond_df,demo,concat_cols,self.concat)
|
449 |
X=X.values.tolist()[0]
|
450 |
-
|
451 |
-
size_concat = self.size_cond+ self.size_proc *
|
452 |
size_aggreg = self.size_cond+ self.size_proc + self.size_meds+ self.size_out+ self.size_chart+ self.size_lab + 4
|
453 |
print('x: ', len(X))
|
454 |
print('size_concat: ', size_concat)
|
455 |
-
print('
|
456 |
if ((self.concat and len(X)==size_concat) or ((not self.concat) and len(X)==size_aggreg)):
|
457 |
yield int(i), {
|
458 |
"label": label,
|
|
|
153 |
timeW = config['timeWindow']
|
154 |
self.timeW=int(timeW.split()[1])
|
155 |
self.bucket = config['timebucket']
|
156 |
+
self.PredW = config['predW']
|
157 |
+
|
|
|
|
|
|
|
158 |
self.data_icu = config['icu_no_icu']=='ICU'
|
159 |
|
160 |
if self.data_icu:
|
|
|
444 |
demo=demo.drop(['label'],axis=1)
|
445 |
X= generate_ml(dyn_df,cond_df,demo,concat_cols,self.concat)
|
446 |
X=X.values.tolist()[0]
|
447 |
+
interv = ((self.timeW + self.PredW)//self.bucket) + (self.config.name != 'Mortality')
|
448 |
+
size_concat = self.size_cond+ self.size_proc * interv + self.size_meds * interv+ self.size_out * interv+ self.size_chart *interv+ self.size_lab * interv + 4
|
449 |
size_aggreg = self.size_cond+ self.size_proc + self.size_meds+ self.size_out+ self.size_chart+ self.size_lab + 4
|
450 |
print('x: ', len(X))
|
451 |
print('size_concat: ', size_concat)
|
452 |
+
print('interv: ', interv)
|
453 |
if ((self.concat and len(X)==size_concat) or ((not self.concat) and len(X)==size_aggreg)):
|
454 |
yield int(i), {
|
455 |
"label": label,
|