Plot model’s feature importances.
booster (Booster or LGBMModel) – Booster or LGBMModel instance which feature importance should be plotted.
ax (matplotlib.axes.Axes or None, optional (default=None)) – Target axes instance. If None, new figure and axes will be created.
height (float, optional (default=0.2)) – Bar height, passed to ax.barh()
.
xlim (tuple of 2 elements or None, optional (default=None)) – Tuple passed to ax.xlim()
.
ylim (tuple of 2 elements or None, optional (default=None)) – Tuple passed to ax.ylim()
.
title (str or None, optional (default="Feature importance")) – Axes title. If None, title is disabled.
xlabel (str or None, optional (default="Feature importance")) – X-axis title label. If None, title is disabled. @importance_type@ placeholder can be used, and it will be replaced with the value of importance_type
parameter.
ylabel (str or None, optional (default="Features")) – Y-axis title label. If None, title is disabled.
importance_type (str, optional (default="auto")) – How the importance is calculated. If “auto”, if booster
parameter is LGBMModel, booster.importance_type
attribute is used; “split” otherwise. If “split”, result contains numbers of times the feature is used in a model. If “gain”, result contains total gains of splits which use the feature.
max_num_features (int or None, optional (default=None)) – Max number of top features displayed on plot. If None or <1, all features will be displayed.
ignore_zero (bool, optional (default=True)) – Whether to ignore features with zero importance.
figsize (tuple of 2 elements or None, optional (default=None)) – Figure size.
dpi (int or None, optional (default=None)) – Resolution of the figure.
grid (bool, optional (default=True)) – Whether to add a grid for axes.
precision (int or None, optional (default=3)) – Used to restrict the display of floating point values to a certain precision.
**kwargs – Other parameters passed to ax.barh()
.
ax – The plot with model’s feature importances.
matplotlib.axes.Axes
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4