def test_dataset(self): dataset = TUHEEGAbnormalDataset(self.PATH) preprocessing = Pipeline([ CommonChannelSet(), LowestFrequency(), BandPassFrequency(0.1, 47), ToDataframe(), DynamicWindow(4), JoinedPreprocessor(inputs=[[ BinarizedSpearmanCorrelation(), CorrelationToAdjacency() ], Bandpower()], output=GraphWithFeatures()) ]) dataset = dataset.set_pipeline(preprocessing).load()
BinarizedSpearmanCorrelation, ToNumpy dataset = TUHEEGAbnormalDataset('../../data/tuh_eeg_abnormal/v2.0.0/edf') dataset.set_cache_manager(SinglePickleCache('../../export')) preprocessing = Pipeline([ CommonChannelSet(), LowestFrequency(), BandPassFrequency(0.1, 47), ToDataframe(), DynamicWindow(8), BinarizedSpearmanCorrelation(), ToNumpy() ]) dataset = dataset.set_pipeline(preprocessing).load() data, labels = dataset['data'], dataset['labels'] adjs = data[0].shape[0] classes = len(set(labels)) input_shape = data[0].shape[1:] inputs = [[] for _ in range(adjs)] for d in data: for i in range(adjs): inputs[i].append(d[i].reshape((*input_shape, 1))) data = [np.array(i) for i in inputs] total_acc = 0 n_splits = 10 skf = StratifiedKFold(n_splits=n_splits, shuffle=True)