pyreal.visualize.plot_explanation#
- pyreal.visualize.plot_explanation(explanation, feature=None, num_features=5, predictions=None, discrete=False, show=False, filename=None, **kwargs)[source]#
Plots a RealApp output or Pyreal explanation using the most appropriate visualization method
- Parameters:
explanation (Explanation object or valid RealApp explanation format) – The explanation to plot
feature (string) – If given, generate a plot for this explanation. Currently ignored for all explanation types except single entity feature contribution explanations.
num_features (int) – If the plot shows multiple features, the number of features to plot
predictions (numeric, string, or array-like) – Prediction(s) of inputs rows being explained, optionally shown in some visualization types
discrete (Boolean) – True if features should be plotted as having categorical or discrete values, False if continuous. Only used for some visualization types.
show (Boolean) – If True, show the plot after generating
filename (string) – If given, save the figure as filename
**kwargs – Additional arguments to pass to the selected plot