eugene.plot.performance_summary

eugene.plot.performance_summary(sdata, target_var, prediction_vars=None, prediction_groups=None, groupby=None, add_swarm=False, size=5, metrics='r2', orient='v', rc_context={'axes.labelsize': 14, 'axes.titlesize': 16, 'legend.fontsize': 12, 'pdf.fonttype': 42, 'ps.fonttype': 42, 'xtick.labelsize': 12, 'ytick.labelsize': 12}, return_axes=False, save=None, **kwargs)

Plot a performance summary across model predictions for a passed in metric

Uses model predictions and targets to calculate a set of metrics and plot them.

Parameters:
  • sdata (pd.DataFrame) – A dataframe containing the target and prediction columns in target_var and prediction_vars respectively.

  • target_var (str) – The name of the column in sdataframe containing the target values.

  • prediction_vars (list, optional) – A list of the names of the columns in sdataframe containing the prediction values. If None, all columns containing “predictions” in their name will be used.

  • prediction_groups (list, optional) – A list of the names of the groups for each prediction column.

  • groupby (str, optional) – The name of the column in sdataframe to group by. If None, the prediction_groups will be used.

  • add_swarm (bool, optional) – Whether to add a swarmplot to the violinplot. Default is False.

  • size (int, optional) – The size of the points to plot if add_swarm is True. Default is 5.

  • metrics (str, optional) – The name of the metrics to calculate.

  • orient (str, optional) – The orientation of the plot. Default is “v”.

  • rc_context (dict, optional) – A dictionary of rcParams to pass to matplotlib. Default is settings.rc_context.

  • return_axes (bool, optional) – Whether to return the axes object. Default is False.

  • save (PathLike, optional) – The path to save the figure to. Default is None.

  • **kwargs – Additional keyword arguments to pass to sns.violinplot.

Returns:

ax

Return type:

matplotlib.axes.Axes