# -*- coding: utf-8 -*-
# !/usr/bin/python

import os
import pickle
import numpy as np
#输入要读入的特征,此类特征是经过特殊算法压缩过后的特征
def getNewFeat(sel_model,method,flag = 'train'):
    files = os.listdir('featfile')
    if len(files) < 1:
        return
    feats = []
    for f in files:
        temp = f.split('_')
        if len(temp) != 3:
            continue
        if temp[0] == flag and temp[1] in sel_model:
            ind = sel_model.index(temp[1])
            tts= temp[2].split('.')[0]
            if temp[2].split('.')[0] == method[ind]:
                feat = pickle.load(open('featfile\\' + f, 'rb'))
                feats.append(feat)
    g = np.hstack(c for c in feats)
    return g

