def parse_feature_importances(filepath):
 lines = open(filepath, 'U').readlines()
 feature_IDs = []
 scores = []
 for line in lines[1:]:
  words = line.strip().split(' DCTB ')
  feature_IDs.append(words[0].strip())
  scores.append(float(words[1].strip()))
 return (array(feature_IDs), array(scores))

def parse_feature_importances ( filepath ) : lines = open ( filepath , 'U' ) . readlines ( ) feature_IDs = [ ] scores = [ ] for line in lines [ 1 : ] : words = line . strip ( ) . split ( ' DCTB ' ) feature_IDs . append ( words [ 0 ] . strip ( ) ) scores . append ( float ( words [ 1 ] . strip ( ) ) ) return ( array ( feature_IDs ) , array ( scores ) )
returns vector of feature ids .