calour.training.plot_prc

calour.training.plot_prc(result, classes=None, title='precision-recall curve', cmap=None, ax=None)[source]

Plot precision-recall curve.

Parameters:
  • result (pandas.DataFrame) – data frame containing predictions per sample (in row). It must have a column of true class named “Y_TRUE” and multiple columns of predicted probabilities for each class. It typically takes the output of classify().
  • classes (list) – The list of the labels you want to include in the plot in the order specified in the list. If it is a binary classification (eg “Health” vs. “IBD”), you would want to set it to [“IBD”] and don’t plot for “Health” because it is equivalent.
  • title (str) – plot title
  • cmap (str or matplotlib.colors.ListedColormap) – str to indicate the colormap name. Default is “Dark2” colormap. For all available colormaps in matplotlib: https://matplotlib.org/users/colormaps.html
  • ax (matplotlib.axes.Axes or None (default), optional) – The axes where to plot. None (default) to create a new figure and axes to plot
Returns:

The axes for the curve

Return type:

matplotlib.axes.Axes

See also

plot_roc()