From 202914f72402db635ddc418bddbeabee212ffe25 Mon Sep 17 00:00:00 2001 From: Shing Chan Date: Fri, 22 Sep 2023 18:28:55 +0100 Subject: [PATCH] trim trailing whitespaces --- downstream_task_evaluation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/downstream_task_evaluation.py b/downstream_task_evaluation.py index f2c5411..bcc55a1 100644 --- a/downstream_task_evaluation.py +++ b/downstream_task_evaluation.py @@ -503,8 +503,11 @@ def handcraft_features(xyz, sample_rate): feats["std"] = np.std(m) feats["range"] = np.ptp(m) feats["mad"] = stats.median_abs_deviation(m) - feats["kurt"] = stats.kurtosis(m) - feats["skew"] = stats.skew(m) + if feats['std'] > .01: + feats['skew'] = np.nan_to_num(stats.skew(m)) + feats['kurt'] = np.nan_to_num(stats.kurtosis(m)) + else: + feats['skew'] = feats['kurt'] = 0 feats["enmomean"] = np.mean(np.abs(m - 1)) # Spectrum using Welch's method with 3s segment length