radshap.plot.plot_bars
- radshap.plot.plot_bars(shapley_values, nbest=10, names=None, sort=True, ax=None)[source]
Plot the Shapley values of different instances with a bar plot.
- Parameters:
- shapley_values1D array shape (n_shapley_values,)
Shapley values.
- nbestint, optional.
Number of values to display on the bar plot. The nbest features with the highest Shapley values (absolute value) will be displayed. If the tolal number of regions is lower than nbest all the values will be displayed. Only valid when sort is True. The default is 10.
- nameslist of strings or None, optional.
Names of the regions associated to the Shapley values. If None default names ‘instance_0’, …, ‘instance_n’ will be used. The default is None.
- sortbool, optional.
If true Shapley values are ranked from top to bottom in decreasing order with respect to their absolute value. If False all the regions will be displayed on the bar plot. The default is True.
- axmatplotlib.axes, optional
The default is None.
- Returns:
- None.