fixed plot_dataset_example.py
@@ -22,46 +22,34 @@ print(ds.datasets[-1].info)
print(ds.info)
# we can easily split ds based on a criterium in the info DataFrame
-eval_set, train_set = ds.split("session")
+subsets = ds.split("session")
+print(subsets)
# quick check whether the split did what we intended
-print(ds.info.iloc[train_set.indices])
-print(ds.info.iloc[eval_set.indices])
+print(ds.info.iloc[subsets["session_T"].indices])
+print(ds.info.iloc[subsets["session_E"].indices])
# again we can iterate through the subsets as through the ds
-for x, y, info in eval_set:
+for x, y, info in subsets["session_E"]:
print(x.get_data().shape, y, info)
break
# create a dataset based on TUH Abnormal EEG Corpus (v2.0.0)
# for this dataset, no events exist but a label (pathological / non-pathological
# is valid for the entire recording
-ds = TUHAbnormal(subject_ids=[0, 1], trial_start_offset_samples=0,
- trial_stop_offset_samples=1000, supercrop_size_samples=1000,
- supercrop_stride_samples=1000, mapping={False: 0, True: 1})
+# ds = TUHAbnormal(path="/path/to/the/directory/",
+# subject_ids=[0, 1], trial_start_offset_samples=0,
+# trial_stop_offset_samples=1000, supercrop_size_samples=1000,
+# supercrop_stride_samples=1000, mapping={False: 0, True: 1})
# as before, we can iterate through the dataset, getting the same kind of info
-for x, y, info in ds:
- print(x.get_data().shape, y, info)
- break
+# for x, y, info in ds:
+# print(x.get_data().shape, y, info)
+# break
# we can change the target for this dataset to 'age'
-ds = TUHAbnormal(subject_ids=[0, 1], trial_start_offset_samples=0,
- trial_stop_offset_samples=1000, supercrop_size_samples=1000,
- supercrop_stride_samples=1000, target="age",
- mapping={False: 0, True: 1})
-
-for x, y, info in ds:
- print(x.get_data().shape, y, info)
- break
-
-# and we can split the dataset based on pathology status
-normal, abormal = ds.split("pathological")
-
-for x, y, info in ds:
- print(x.get_data().shape, y, info)
- break
-
-for x, y, info in ds:
- print(x.get_data().shape, y, info)
- break
+# ds = TUHAbnormal(path="/path/to/the/directory/",
+# subject_ids=[0, 1], trial_start_offset_samples=0,
+# trial_stop_offset_samples=1000, supercrop_size_samples=1000,
+# supercrop_stride_samples=1000, target="age",
+# mapping={False: 0, True: 1})
