Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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)