Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +9 -13
Mimic4Dataset.py
CHANGED
@@ -17,44 +17,41 @@ _HOMEPAGE = "https://huggingface.co/datasets/thbndi/Mimic4Dataset"
|
|
17 |
_CITATION = "https://proceedings.mlr.press/v193/gupta22a.html"
|
18 |
_GITHUB = "https://github.com/healthylaife/MIMIC-IV-Data-Pipeline/tree/main"
|
19 |
|
20 |
-
class
|
21 |
-
|
22 |
-
|
23 |
def __init__(
|
24 |
self,
|
25 |
mimic_path,
|
26 |
#config,
|
27 |
**kwargs,
|
28 |
):
|
29 |
-
|
30 |
self.mimic_path = mimic_path
|
31 |
-
super(
|
|
|
32 |
#self.config = config
|
33 |
#cohort.task_cohort(self.task,self.mimic_path)
|
34 |
-
|
35 |
|
36 |
-
class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
37 |
-
VERSION = datasets.Version("1.0.0")
|
38 |
BUILDER_CONFIGS = [
|
39 |
-
|
40 |
name="Phenotype",
|
41 |
version=VERSION,
|
42 |
data_dir=os.path.abspath("./data/dict/cohort_icu_readmission_30_I50"),
|
43 |
description="Dataset for mimic4 Phenotype task"
|
44 |
),
|
45 |
-
|
46 |
name="Readmission",
|
47 |
version=VERSION,
|
48 |
data_dir=os.path.abspath("./data/dict"),
|
49 |
description="Dataset for mimic4 Readmission task",
|
50 |
),
|
51 |
-
|
52 |
name="Length of Stay",
|
53 |
version=VERSION,
|
54 |
data_dir=os.path.abspath("./data/dict"),
|
55 |
description="Dataset for mimic4 Length of Stay task",
|
56 |
),
|
57 |
-
|
58 |
name="Mortality",
|
59 |
version=VERSION,
|
60 |
data_dir=os.path.abspath("./data/dict"),
|
@@ -103,7 +100,6 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
103 |
|
104 |
def _split_generators(self, dl_manager):
|
105 |
data_dir = self.config.data_dir + "/dataDic"
|
106 |
-
mimic=self.mimic_path
|
107 |
return [
|
108 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_dir}),
|
109 |
]
|
|
|
17 |
_CITATION = "https://proceedings.mlr.press/v193/gupta22a.html"
|
18 |
_GITHUB = "https://github.com/healthylaife/MIMIC-IV-Data-Pipeline/tree/main"
|
19 |
|
20 |
+
class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
21 |
+
VERSION = datasets.Version("1.0.0")
|
22 |
+
|
23 |
def __init__(
|
24 |
self,
|
25 |
mimic_path,
|
26 |
#config,
|
27 |
**kwargs,
|
28 |
):
|
|
|
29 |
self.mimic_path = mimic_path
|
30 |
+
super().__init__(**kwargs)
|
31 |
+
|
32 |
#self.config = config
|
33 |
#cohort.task_cohort(self.task,self.mimic_path)
|
|
|
34 |
|
|
|
|
|
35 |
BUILDER_CONFIGS = [
|
36 |
+
datasets.GeneratorBasedBuilder(
|
37 |
name="Phenotype",
|
38 |
version=VERSION,
|
39 |
data_dir=os.path.abspath("./data/dict/cohort_icu_readmission_30_I50"),
|
40 |
description="Dataset for mimic4 Phenotype task"
|
41 |
),
|
42 |
+
datasets.GeneratorBasedBuilder(
|
43 |
name="Readmission",
|
44 |
version=VERSION,
|
45 |
data_dir=os.path.abspath("./data/dict"),
|
46 |
description="Dataset for mimic4 Readmission task",
|
47 |
),
|
48 |
+
datasets.GeneratorBasedBuilder(
|
49 |
name="Length of Stay",
|
50 |
version=VERSION,
|
51 |
data_dir=os.path.abspath("./data/dict"),
|
52 |
description="Dataset for mimic4 Length of Stay task",
|
53 |
),
|
54 |
+
datasets.GeneratorBasedBuilder(
|
55 |
name="Mortality",
|
56 |
version=VERSION,
|
57 |
data_dir=os.path.abspath("./data/dict"),
|
|
|
100 |
|
101 |
def _split_generators(self, dl_manager):
|
102 |
data_dir = self.config.data_dir + "/dataDic"
|
|
|
103 |
return [
|
104 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_dir}),
|
105 |
]
|