scparadise.scnoah.conf_matrix

Contents

scparadise.scnoah.conf_matrix#

scparadise.scnoah.conf_matrix(adata, celltype=None, pred_celltype=None, fmt='.2f', annot=True, cmap='Blues', ndigits_metrics=3, grid=False, **kwargs)[source]#

Compute confusion matrix to evaluate the accuracy of a classification.

Parameters:
  • adata (AnnData) – Annotated data matrix. Function uses adata.X for oversample.

  • celltype (str, (default: None)) – Cell annotation. Key in adata.obs dataframe.

  • pred_celltype (str, (default: None)) – Predicted cell annotation. Key in adata.obs dataframe.

  • fmt (str, optional) – String formatting code to use when adding annotations.

  • annot (bool or rectangular dataset, optional) – If True, write the data value in each cell. If an array-like with the same shape as data, then use this to annotate the heatmap instead of the data. Note that DataFrames will match on position, not index.

  • cmap (matplotlib colormap name or object, or list of colors, optional) – The mapping from data values to color space. If not provided, the default will depend on whether center is set.

  • ndigits_metrics (int (default: 3)) – Round a n accuracy and balanced accuracy to a given precision in decimal digits.

  • grid (bool (default: False)) – Show or hide grid lines.

  • **kwargs (other keyword arguments) – All other keyword arguments are passed to sns.heatmap