xgboost 输出重要特征

def ceate_feature_map(file_name,features):
    outfile = open(file_name, 'w')
    for i, feat in enumerate(features):
        outfile.write('{0}\t{1}\tq\n'.format(i, feat))
        #feature type, use i for indicator and q for quantity  outfile.close()
feature_score = bst.get_fscore()
help(bst)
pd.Series(bst.get_fscore()).sort_values(ascending=False)

 

展开阅读全文

没有更多推荐了,返回首页