tabensemb.trainer.Trainer.plot_partial_dependence#
method
- Trainer.plot_partial_dependence(program: str, model_name: str, feature: str, ax=None, refit: bool = True, log_trans: bool = True, lower_lim: float = 2, upper_lim: float = 7, n_bootstrap: int = 1, grid_size: int = 30, CI: float = 0.95, verbose: bool = True, figure_kwargs: Dict | None = None, plot_kwargs: Dict | None = None, fill_between_kwargs: Dict | None = None, bar_kwargs: Dict | None = None, hist_kwargs: Dict | None = None, savefig_kwargs: Dict | None = None, save_show_close: bool = True) Axes[source]#
Calculate and plot a partial dependence plot with bootstrapping for a feature.
- Parameters:
- program
The selected model base.
- model_name
The selected model in the model base.
- feature
The selected feature to calculate partial dependence.
- ax
matplotlib.axes.Axes- refit
Whether to refit models on bootstrapped datasets. See
_bootstrap_fit().- log_trans
Whether the label data is in log scale.
- lower_lim
Lower limit of all pdp plots.
- upper_lim
Upper limit of all pdp plot.
- n_bootstrap
The number of bootstrap evaluations. It should be greater than 0.
- grid_size
The number of steps of all pdp plot.
- CI
The confidence interval of pdp results calculated across multiple bootstrap runs.
- verbose
Verbosity
- figure_kwargs
Arguments for
plt.figure.- plot_kwargs
Arguments for
ax.plot.- fill_between_kwargs
Arguments for
ax.fill_between.- bar_kwargs
Arguments for
ax.bar(used for frequencies of categorical features).- hist_kwargs
Arguments for
ax.hist(used for histograms of continuous features).- savefig_kwargs
Arguments for
plt.savefig- save_show_close
Whether to save, show (in the notebook), and close the figure if
axis not given.
- Returns:
- matplotlib.axes.Axes