def test_higuchi_fd(self): """Test for function `higuchi_fd`. Results have been tested against the MNE-features and pyrem packages. """ # Compare with MNE-features self.assertEqual(np.round(higuchi_fd(RANDOM_TS), 8), 1.9914198) higuchi_fd(list(RANDOM_TS), kmax=20)
def HiguchiFract(RR_windows, **kwargs): feat = [] for wRR in RR_windows: try: value = entropy.higuchi_fd(wRR, kmax=5) except: value = np.nan feat.append(value) return feat
def get_HFD_at(self, channel, kMax=None): """ Computes Higuchi Fractal dimension per channel. :param channel: Channel to compute Higuchi Fractal dimension. :param kMax: kmax required for Higuchi. :return: Higuchi fractal dimension. """ channel_data = self.__get_raw_data_at__(channel) n = len(channel_data) kMax = (n // 2) - 1 if kMax is None else kMax data = entropy.higuchi_fd(channel_data, kMax) return data
def handle_raw(raw): res = [] for x in const.brain: temp = [] temp.append(x) raw_temp = raw.copy().pick_channels(temp) data = raw_temp.get_data()[0] hfd = higuchi_fd(data) kfd = katz_fd(data) res.append(hfd) res.append(kfd) return res
def higuchi(x): return entropy.higuchi_fd(x, kmax=10)