def plot_importance(importance_type='weight'):
"""
How the importance is calculated: either "weight", "gain", or "cover"
"weight" is the number of times a feature appears in a tree
"gain" is the average"gain"of splits which use the feature
"cover" is the average coverage of splits which use the feature
where coverage is defined as the number of samples affected by the split
"""
xgb.plot_importance(model, importance_type=importance_type,
max_num_features=40,
)
plot_model.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录