Shortening input CSVs' and added test for ACC.
parent
d1c59de2e9
commit
bd5a811256
|
@ -0,0 +1,32 @@
|
|||
import sys
|
||||
sys.path.append("..")
|
||||
from CalculatingFeatures.helper_functions import convert1DEmpaticaToArray, convertInputInto2d, accelerometerFeatureNames, frequencyFeatureNames
|
||||
from CalculatingFeatures.helper_functions import convert3DEmpaticaToArray
|
||||
from CalculatingFeatures.calculate_features import calculateFeatures
|
||||
|
||||
import pandas as pd
|
||||
|
||||
pathToAccCsv = "../example_data/S2_E4_Data_shortened/ACC.csv"
|
||||
windowLength = 500
|
||||
|
||||
#np.seterr(all='raise')
|
||||
|
||||
# get an array of values from ACC empatica file
|
||||
acc_data, startTimeStamp, sampleRate = convert3DEmpaticaToArray(pathToAccCsv)
|
||||
acc_data = acc_data[:, :int(300000//sampleRate)]
|
||||
|
||||
# Convert the ACC data into 2D array
|
||||
x_2D = convertInputInto2d(acc_data[0], windowLength)
|
||||
y_2D = convertInputInto2d(acc_data[1], windowLength)
|
||||
z_2D = convertInputInto2d(acc_data[2], windowLength)
|
||||
|
||||
# Create a list with feature names
|
||||
featureNames = []
|
||||
featureNames.extend(accelerometerFeatureNames)
|
||||
featureNames.extend(frequencyFeatureNames)
|
||||
|
||||
pd.set_option('display.max_columns', None)
|
||||
|
||||
# Calculate features
|
||||
calculatedFeatures = calculateFeatures(x_2D, y_2D, z_2D, fs=int(sampleRate), featureNames=featureNames)
|
||||
print(calculatedFeatures)
|
|
@ -57,7 +57,7 @@ plt.savefig('output_images/EDA_exa2.png')
|
|||
|
||||
print(df_EDA.loc[no_interest, df_EDA.columns.str.contains('Peak')])
|
||||
|
||||
# calculatedFeatures_EDA = calculateFeatures(eda_data_2D, fs=int(sampleRate_EDA), featureNames=gsrFeatureNames)
|
||||
# print(calculatedFeatures_EDA)
|
||||
calculatedFeatures_EDA = calculateFeatures(eda_data_2D, fs=int(sampleRate_EDA), featureNames=gsrFeatureNames)
|
||||
print(calculatedFeatures_EDA)
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ windowLength = 500
|
|||
|
||||
# get an array of values from HRV empatica file
|
||||
hrv_data, startTimeStamp, sampleRate = convert1DEmpaticaToArray(pathToHrvCsv)
|
||||
hrv_data = hrv_data[:int(300000//sampleRate)]
|
||||
|
||||
# Convert the HRV data into 2D array
|
||||
hrv_data_2D = convertInputInto2d(hrv_data, windowLength)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
# Temparature features do not exist - should be used from the RAPIDS defaults?
|
Loading…
Reference in New Issue