-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreprocessing_overhead.py
39 lines (35 loc) · 1.19 KB
/
preprocessing_overhead.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# import required module
import os
# from sklearn import preprocessing
from preprocessing import Preprocessing as pp
# assign directory where the data files are stored
directory = r'./data/115'
# create a Preprocessing object
print("What do you want to do")
print("1. Fractal decomposition for EEG")
print("2. clean eeg data")
print("3. Fractal decomposition for ACC and Gyro")
print("4. clean acc and gyro data")
x = int(input("Enter 1,2,3,4\n"))
if x == 1:
preprocessing = pp()
preprocessing.createSimpleExtractionCSVEEG(directory)
elif x == 2:
preprocessing = pp()
preprocessing.createSimpleExtractionCSVEEG(directory)
for filename in os.listdir(directory):
f = os.path.join(directory, filename)
# checking if it is a file
if os.path.isfile(f):
returned_df = preprocessing.preprocess(f)
if returned_df is not None:
preprocessing.save_data(f, returned_df)
elif x ==3:
preprocessing = pp()
preprocessing.createSimpleExtractionCSVACC(directory)
preprocessing.createSimpleExtractionCSVGYRO(directory)
elif x == 4:
preprocessing = pp()
preprocessing.preprocessMotion(directory)
else:
print("Invalid input")