gpt4 book ai didi

python - xgboost 图重要性图大小

转载 作者:太空狗 更新时间:2023-10-30 01:42:37 44 4
gpt4 key购买 nike

如何更改 xgboost 的绘图重要性函数的图形大小?

尝试传递 figsize=(10,20) 失败,但未知属性除外。

最佳答案

您可以在 plot_importance()ax 参数中传递一个轴。例如,使用这个包装器:

def my_plot_importance(booster, figsize, **kwargs): 
from matplotlib import pyplot as plt
from xgboost import plot_importance
fig, ax = plt.subplots(1,1,figsize=figsize)
return plot_importance(booster=booster, ax=ax, **kwargs)

然后使用 my_plot_importance() 而不是 plot_importance()

关于python - xgboost 图重要性图大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40081888/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com