def load_data(path, name_seq, name_track, labels_folder): """ Load data from csv file """ list_states = [] data_base = pd.read_csv(path + '/data_csv/' + name_seq + '.csv') ref_data = DataBase(path + '/', name_seq) list_features = list(data_base.columns.values) del list_features[0:2] dim_features = np.ones(len(list_features)) time = data_base['timestamps'] labels, states = ref_data.load_labels_refGT(time, name_track, 'labels_3A') data = data_base[list_features].as_matrix() for state in states: if (state not in list_states): list_states.append(state) list_states = sorted(list_states) return data, labels, time, list_states, list_features
for file in list_files: name_seq = os.path.splitext(file)[0] info_participant.append(participant) info_sequences.append(name_seq) data_base = pd.read_csv(path_data + file) ref_data = DataBase(path + '/' + participant, name_seq) list_features = list(data_base.columns.values) del list_features[0:2] dim_features = np.ones(len(list_features)) time = data_base['timestamps'] labels, states = ref_data.load_labels_refGT( time, name_track, 'labels_3A') real_labels.append(labels) data_win2.append(data_base[list_features].as_matrix()) timestamps.append(time) for state in states: if (state not in list_states): list_states.append(state) list_states = sorted(list_states) i += 1 #################################################################################### # Feature Selection #################################################################################### obs = []