tabensemb.trainer.Trainer.plot_feature_importance#
method
- Trainer.plot_feature_importance(program: str, model_name: str, method: str = 'permutation', importance: ndarray | None = None, feature_names: List[str] | None = None, clr: Iterable | None = None, ax=None, figure_kwargs: Dict | None = None, bar_kwargs: Dict | None = None, legend_kwargs: Dict | None = None, savefig_kwargs: Dict | None = None, save_show_close: bool = True, **kwargs) Axes[source]#
Plot feature importance of a model using
cal_feature_importance().- Parameters:
- program
The selected model base.
- model_name
The selected model in the model base.
- method
The method to calculate feature importance. “permutation” or “shap”.
- importance
Passing feature importance values directly instead of calling
tabensemb.model.AbstractModel.cal_feature_importance()internally in this method.- feature_names
Names of features assigned to each importance value.
- clr
A seaborn color palette or an Iterable of colors. For example seaborn.color_palette(“deep”).
- ax
matplotlib.axes.Axes- figure_kwargs
Arguments for
plt.figure- bar_kwargs
Arguments for
seaborn.barplot.- legend_kwargs
Arguments for
plt.legend- savefig_kwargs
Arguments for
plt.savefig- save_show_close
Whether to save, show (in the notebook), and close the figure if
axis not given.- kwargs
Other arguments of
tabensemb.model.AbstractModel.cal_feature_importance()
- Returns:
- matplotlib.axes.Axes