Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +9 -8
Mimic4Dataset.py
CHANGED
|
@@ -19,9 +19,9 @@ mimic path should have this form : "absolute/path/to/mimic4data/mimiciv/2.2"
|
|
| 19 |
_HOMEPAGE = "https://huggingface.co/datasets/thbndi/Mimic4Dataset"
|
| 20 |
_CITATION = "https://proceedings.mlr.press/v193/gupta22a.html"
|
| 21 |
_URL = "https://github.com/healthylaife/MIMIC-IV-Data-Pipeline"
|
| 22 |
-
_DATA_GEN = 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/
|
| 23 |
-
_COHORT = 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/
|
| 24 |
-
_CONFIG_URLS = {'los' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/blob/
|
| 25 |
'mortality' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/resolve/main/config/los.config',
|
| 26 |
'phenotype' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/resolve/main/config/phenotype.config',
|
| 27 |
'readmission' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/resolve/main/config/readmission.config'
|
|
@@ -152,8 +152,9 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
| 152 |
file_path, head = urlretrieve(self.config_path)
|
| 153 |
else :
|
| 154 |
file_path = self.config_path
|
| 155 |
-
|
| 156 |
-
|
|
|
|
| 157 |
shutil.move(file_path, path_bench+'/config')
|
| 158 |
|
| 159 |
|
|
@@ -168,9 +169,9 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
| 168 |
data_dir = path_bench + "/data/dataDic"
|
| 169 |
sys.path.append(path_bench)
|
| 170 |
config = self.config_path.split('/')[-1]
|
| 171 |
-
script = 'python
|
| 172 |
-
|
| 173 |
-
os.system(script)
|
| 174 |
return [
|
| 175 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_dir}),
|
| 176 |
]
|
|
|
|
| 19 |
_HOMEPAGE = "https://huggingface.co/datasets/thbndi/Mimic4Dataset"
|
| 20 |
_CITATION = "https://proceedings.mlr.press/v193/gupta22a.html"
|
| 21 |
_URL = "https://github.com/healthylaife/MIMIC-IV-Data-Pipeline"
|
| 22 |
+
_DATA_GEN = 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/blob/main/data_generation_icu_modify.py'
|
| 23 |
+
_COHORT = 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/blob/main/cohort.py'
|
| 24 |
+
_CONFIG_URLS = {'los' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/blob/main/config/los.config',
|
| 25 |
'mortality' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/resolve/main/config/los.config',
|
| 26 |
'phenotype' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/resolve/main/config/phenotype.config',
|
| 27 |
'readmission' : 'https://huggingface.co/datasets/thbndi/Mimic4Dataset/resolve/main/config/readmission.config'
|
|
|
|
| 152 |
file_path, head = urlretrieve(self.config_path)
|
| 153 |
else :
|
| 154 |
file_path = self.config_path
|
| 155 |
+
conf=path_bench+'/config/'+self.config_path.split('/')[-1]+'.config'
|
| 156 |
+
print(conf)
|
| 157 |
+
if not os.path.exists(path_bench+'/config/'+self.config_path.split('/')[-1]+'.config'):
|
| 158 |
shutil.move(file_path, path_bench+'/config')
|
| 159 |
|
| 160 |
|
|
|
|
| 169 |
data_dir = path_bench + "/data/dataDic"
|
| 170 |
sys.path.append(path_bench)
|
| 171 |
config = self.config_path.split('/')[-1]
|
| 172 |
+
script = 'python cohort.py '+ self.config.name +" "+ self.mimic_path+ " "+path_bench+ " "+config
|
| 173 |
+
print(script)
|
| 174 |
+
#os.system(script)
|
| 175 |
return [
|
| 176 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_dir}),
|
| 177 |
]
|