2016-10-17 46 views
3

如何更改xgboost情節重要性函數的數字大小?xgboost情節重要性數字大小

嘗試傳遞figsize =(10,20)失敗,但未知屬性例外。

+0

我結束了我自己的滾動基於https://github.com/ViennaKaggle/allstate-claims-severity/blob/master /chris/01_Analysis.ipynb –

回答

8

您可以在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()