def calc_features(frame): acc_x = frame["acc_x"] acc_y = frame["acc_y"] acc_z = frame["acc_z"] gyro_x = frame["gyro_x"] gyro_y = frame["gyro_y"] gyro_z = frame["gyro_z"] flex_index = frame["flex_index"] flex_pinky = frame["flex_pinky"] acc_mean_x = calc.mean(acc_x) acc_mean_y = calc.mean(acc_y) acc_mean_z = calc.mean(acc_z) acc_std_x = calc.std(acc_x) acc_std_y = calc.std(acc_y) acc_std_z = calc.std(acc_z) acc_mad_x = calc.mad(acc_x) acc_mad_y = calc.mad(acc_y) acc_mad_z = calc.mad(acc_z) acc_max_x = calc.max(acc_x) acc_max_y = calc.max(acc_y) acc_max_z = calc.max(acc_z) acc_min_x = calc.min(acc_x) acc_min_y = calc.min(acc_y) acc_min_z = calc.min(acc_z) acc_iqr_x = calc.iqr(acc_x) acc_iqr_y = calc.iqr(acc_y) acc_iqr_z = calc.iqr(acc_z) acc_correlation_1 = calc.correlation(acc_x, acc_y) acc_correlation_2 = calc.correlation(acc_x, acc_z) acc_correlation_3 = calc.correlation(acc_y, acc_z) gyro_mean_x = calc.mean(gyro_x) gyro_mean_y = calc.mean(gyro_y) gyro_mean_z = calc.mean(gyro_z) gyro_std_x = calc.std(gyro_x) gyro_std_y = calc.std(gyro_y) gyro_std_z = calc.std(gyro_z) gyro_mad_x = calc.mad(gyro_x) gyro_mad_y = calc.mad(gyro_y) gyro_mad_z = calc.mad(gyro_z) gyro_max_x = calc.max(gyro_x) gyro_max_y = calc.max(gyro_y) gyro_max_z = calc.max(gyro_z) gyro_min_x = calc.min(gyro_x) gyro_min_y = calc.min(gyro_y) gyro_min_z = calc.min(gyro_z) gyro_iqr_x = calc.iqr(gyro_x) gyro_iqr_y = calc.iqr(gyro_y) gyro_iqr_z = calc.iqr(gyro_z) gyro_correlation_1 = calc.correlation(gyro_x, gyro_y) gyro_correlation_2 = calc.correlation(gyro_x, gyro_z) gyro_correlation_3 = calc.correlation(gyro_y, gyro_z) feature_frame = [ acc_mean_x, acc_mean_y, acc_mean_z, acc_std_x, acc_std_y, acc_std_z, acc_mad_x, acc_mad_y, acc_mad_z, acc_max_x, acc_max_y, acc_max_z, acc_min_x, acc_min_y, acc_min_z, acc_iqr_x, acc_iqr_y, acc_iqr_z, acc_correlation_1, acc_correlation_2, acc_correlation_3, gyro_mean_x, gyro_mean_y, gyro_mean_z, gyro_std_x, gyro_std_y, gyro_std_z, gyro_mad_x, gyro_mad_y, gyro_mad_z, gyro_max_x, gyro_max_y, gyro_max_z, gyro_min_x, gyro_min_y, gyro_min_z, gyro_iqr_x, gyro_iqr_y, gyro_iqr_z, gyro_correlation_1, gyro_correlation_2, gyro_correlation_3 ] return feature_frame
def test_min(self): self.assertEqual(calc.min(10, 5), 5)