def make_sequences(in_path,out_path,dim=0): action_t_series=utils.read_dir_objects(in_path) sequences=[] for action in action_t_series: arr=action.to_array()[dim] cat_series=category_series(arr) seq=cats_to_seq(cat_series) seq+="#"+str(action.cat) seq+="#"+action.name +"\n" sequences.append(seq) str_seq=utils.array_to_txt(sequences) utils.save_string(out_path,str_seq)
def extract_features(in_path,out_path): action_t_series=utils.read_dir_objects(in_path) features=[category_count(action) for action in action_t_series] utils.to_labeled_file(out_path,features)
def extract_indicator_features(in_path,out_path,ind_id): action_t_series=utils.read_dir_objects(in_path) features=[from_instance(action,ind_id) for action in action_t_series] utils.to_labeled_file(out_path,features)