Exemple #1
0
import numpy as np
from sklearn import preprocessing

from evaluation.compare import compare
from preprocessing.PreProcessor import PreProcessor
from src.filereader.FileReader import FileReader

FILE_PATH = "../../resource/PostureEntry.csv"
N_VALIDATIONS = 4

samples_raw, labels, label_names = FileReader.read(FILE_PATH)

labels = labels[(labels == 4) | (labels == 5)]

samples_raw = samples_raw[(labels == 4) | (labels == 5), :]

# determine g when calibrating
# determine upright angle
# put threshold on angles

samples_features = preprocessing.scale(samples_raw)

compare(samples_features, labels, N_VALIDATIONS)
Exemple #2
0
import numpy as np
from sklearn import preprocessing
from sklearn.decomposition import PCA

from evaluation.compare import compare, compare_selected, classifiers_all
from preprocessing.PreProcessor import PreProcessor
from src.filereader.FileReader import FileReader

FILE_PATH_1 = "../../resource/PostureEntry_DMP_Phil_Monday.csv"
FILE_PATH_2 = "../../resource/PostureEntry_DMP_Sergio_Monday.csv"
FILE_PATH_3 = "../../resource/PostureEntry_DMP_Ozan.csv"

N_VALIDATIONS = 30
samples_raw, labels_raw, label_names = FileReader.readAll(
    [FILE_PATH_1, FILE_PATH_2, FILE_PATH_3])
scores = []
samples_filtered, labels_reduced = PreProcessor.magnitude_theta(
    samples_raw, labels_raw, 5)
samples_features = preprocessing.scale(samples_filtered)

# samples_features = PCA().fit_transform(samples_features)
compare(samples_features, labels_reduced, classifiers_all, N_VALIDATIONS)
Exemple #3
0
import numpy as np
from sklearn import preprocessing

from evaluation.compare import compare
from preprocessing.PreProcessor import PreProcessor
from src.filereader.FileReader import FileReader

FILE_PATH = "../../resource/PostureEntry.csv"
N_VALIDATIONS = 4

FILE_PATH_1 = "../../resource/PostureEntry_11_02_back_sit_stand_phil.csv"

samples_raw, labels, _ = FileReader.read(FILE_PATH_1)

samples_raw = samples_raw[:, 0:6]

window_size = 50
window = PreProcessor.merge_window(samples_raw, window_size)
# p2p = PreProcessor.peak2peak(samples_raw, window_size)

labels_reduced = labels[0::window_size]
labels_reduced = labels_reduced[:-1]

samples_features = window

samples_features = preprocessing.scale(samples_features)

compare(samples_features, labels_reduced, N_VALIDATIONS)