dianna.visualization.tabular

Visualization module for tabular data.

Functions

plot_tabular(→ matplotlib.pyplot.Figure)

Plot feature importance with segments highlighted.

Module Contents

dianna.visualization.tabular.plot_tabular(x: numpy.ndarray, y: List[str], x_label: str = 'Importance score', y_label: str = 'Features', num_features: int | None = None, show_plot: bool | None = True, output_filename: str | None = None, ax: matplotlib.pyplot.Axes | None = None) matplotlib.pyplot.Figure[source]

Plot feature importance with segments highlighted.

Parameters:
  • x (np.ndarray) – 1D array of feature importance scores of one instance

  • y (List[str]) – List of feature names

  • x_label (str) – Label for the x-axis

  • y_label (str) – Label or list of labels for the y-axis

  • num_features (Optional[int]) – Number of most salient features to display

  • show_plot (bool, optional) – Shows plot if true (for testing or writing plots to disk instead).

  • output_filename (str, optional) – Name of the file to save the plot to (optional).

  • ax (matplotlib.Axes, optional) – externally created canvas to plot on.

Returns:

plt.Figure