mlcolvar.explain.sensitivity.plot_sensitivity

class mlcolvar.explain.sensitivity.plot_sensitivity(results, mode='violin', per_class=None, max_features=100, ax=None)[source]

Bases:

Plot results of the sensitivity analysis. They can be plotted in three modes: * Violin plot (‘violin’), showing the density of per-sample sensitivities besides the mean value * Scatter (‘scatter’), plotting the mean and standard deviation of the gradients * Horizontal bar plot (‘barh’) only displaying the mean of the gradients

Parameters:
  • results (dictionary) – sensitity results calculated by sensitivity_analysis

  • mode (string, optional) – (‘violin’,’barh’,’scatter’), by default ‘violin’

  • per_class (bool, optional) – plot per-class statistics if available, by default plot them if available

  • max_features (int, optional) – plot at most max_features, by default 100

  • ax (matplotlib axis, optional) – ax where to plot the results, by default it will be initialized

See also

mlcolvar.utils.explain.sensitivity_analysis

Perform a sensitivity analysis

Returns:

return the generated matplotlib axis if not passed

Return type:

ax

__init__(**kwargs)