lightgbm.plot_split_value_histogram

lightgbm.plot_split_value_histogram(booster, feature, bins=None, ax=None, width_coef=0.8, xlim=None, ylim=None, title='Split value histogram for feature with @index/name@ @feature@', xlabel='Feature split value', ylabel='Count', figsize=None, dpi=None, grid=True, **kwargs)[source]

Plot split value histogram for the specified feature of the model.

Parameters
  • booster (Booster or LGBMModel) – Booster or LGBMModel instance of which feature split value histogram should be plotted.

  • feature (int or str) – The feature name or index the histogram is plotted for. If int, interpreted as index. If str, interpreted as name.

  • bins (int, str or None, optional (default=None)) – The maximum number of bins. If None, the number of bins equals number of unique split values. If str, it should be one from the list of the supported values by numpy.histogram() function.

  • ax (matplotlib.axes.Axes or None, optional (default=None)) – Target axes instance. If None, new figure and axes will be created.

  • width_coef (float, optional (default=0.8)) – Coefficient for histogram bar width.

  • 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="Split value histogram for feature with @index/name@ @feature@")) – Axes title. If None, title is disabled. @feature@ placeholder can be used, and it will be replaced with the value of feature parameter. @index/name@ placeholder can be used, and it will be replaced with index word in case of int type feature parameter or name word in case of str type feature parameter.

  • xlabel (str or None, optional (default="Feature split value")) – X-axis title label. If None, title is disabled.

  • ylabel (str or None, optional (default="Count")) – Y-axis title label. If None, title is disabled.

  • 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.

  • **kwargs – Other parameters passed to ax.bar().

Returns

ax – The plot with specified model’s feature split value histogram.

Return type

matplotlib.axes.Axes