美文网首页
Feature Importance

Feature Importance

作者: 呢嘻嘻嘻嘻嘻 | 来源:发表于2019-05-07 10:29 被阅读0次
    features_list = train_cols
    feature_importance = gbm_encoder_val.feature_importance()
    sorted_idx = np.argsort(feature_importance)
    
    sns.set_style("dark")
    plt.figure(figsize=(12,10))
    plt.grid(True,)
    plt.barh(range(len(sorted_idx)), feature_importance[sorted_idx], 0.5)
    plt.yticks(range(len(sorted_idx)), np.array(train_cols)[sorted_idx])
    
    plt.rcParams['font.size'] =16
    plt.rcParams['font.sans-serif'] = ['Times New Roman']  #用于刻度font
    plt.xlim(0,50000)
    plt.title('Feature importance',font)
    plt.draw()
    plt.savefig('F:DataFolder/coal/pics/feature_importances.jpg')
    plt.show()
    
    feature_importance

    相关文章

      网友评论

          本文标题:Feature Importance

          本文链接:https://www.haomeiwen.com/subject/llosoqtx.html