mmc.plot_confusion()

mmochi.plotting.plot_confusion(adata, levels, hierarchy=None, key_added='lin', holdout_only=True, batch_key=None, save=None, show=True, title_addition=None, **kwargs)

Determine the performance at a single level by creating a confusion plot using high-confidence thresholds as truth.

Parameters:
  • adata (AnnData) – Object containing a DataFrame in the .obsm[key_added] specifiying the results of high_confidence thresholding, training, and classification

  • levels (Union[str, List[str]]) – Level or levels of the classifier to create confusion plots for, “all” creates plots for whole hierarchy

  • hierarchy (default: None) – Hierarchy object with classification level information

  • key_added (str (default: 'lin')) – Key in .obsm, where information on whether a level had a high-confidence call or was training data

  • holdout_only (bool (default: True)) – Whether to only include data that was not trained on

  • batch_key (str (default: None)) – Column within the adata.obs that delineates batches

  • save (str (default: None)) – Filepath to pdf where the plots will be saved

  • show (bool (default: True)) – Whether to show the saved confusion plots

  • title_addition (str (default: None)) – Phrase to add to the title of the confusion plots

  • sklearn.metrics.ConfusionMatrixDisplay.from_predictions() (**kwargs are passed to) –