mmc.plot_confidence()

mmochi.plotting.plot_confidence(adata, levels, hierarchy=None, key_added='lin', probability_suffix='_probabilities', holdout_only=True, batch_key=None, save=None, show=True, title_addition=None, bins=10)

Determine how confident classification is for each subset by displaying calibration curves, which compare the events classified at a given class to its confidence.

Parameters:
  • adata (AnnData) – AnnData object containing .obsm[key_added] and .obs[batch_key]

  • levels (Union[str, List[str]]) – Level or levels of the classifier to create confidence 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 results from high-confidence thresholding and predicted probabilities are stored

  • probability_suffix (str (default: '_probabilities')) – Suffix in .obsm[key_added] the delineates probability data for the classification

  • 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 confidence plots

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

  • bins (int (default: 10)) – Number of bins to split the probability [0,1] interval. See sklearn.calibration.calibration_curve for more details