calour.training.plot_scatter

calour.training.plot_scatter(result, title='', cmap=None, cor=<function pearsonr>, cv=False, ax=None, **kwargs)[source]

Plot prediction vs. observation for regression.

Parameters:
  • result (pandas.DataFrame) – data frame containing predictions per sample (in row). It must have a column of true class named “Y_TRUE”. It must have a column of predicted class named “Y_PRED”. It typically takes the output of classify().
  • title (str) – plot title
  • cmap (str or matplotlib.colors.ListedColormap) – str to indicate the colormap name. Default is “Blues” colormap. For all available colormaps in matplotlib: https://matplotlib.org/users/colormaps.html
  • cor (Callable or None) – a correlation function that takes predicted y and observed y as inputs and returns correlation coefficient and p-value. If None, don’t compute and label correlation on the plot.
  • cv (boolean) – Whether to color the plot by different folds of cross validation. You need to have ‘CV’ column in the input result data frame.
  • ax (matplotlib.axes.Axes or None (default), optional) – The axes where the confusion matrix is plotted. None (default) to create a new figure and axes to plot the confusion matrix
  • kwargs (dict) – keyword arguments passing to matplotlib.pyplot.scatter()
Returns:

The axes for the confusion matrix

Return type:

matplotlib.axes.Axes