spapros.ev.ProbesetEvaluator.plot_confusion_matrix

ProbesetEvaluator.plot_confusion_matrix(set_ids=None, **kwargs)

Plot heatmaps of cell type classification confusion matrices

Parameters:
  • set_ids (Optional[List[str]]) – List of probeset IDs. Check out ProbesetEvaluator.summary_results for available sets.

  • **kwargs – Any keyword argument from confusion_matrix().

Return type:

None

Example

import spapros as sp
adata = sp.ut.get_processed_pbmc_data()
selections = sp.se.select_reference_probesets(adata,methods=["DE","HVG","random"],n=30,verbosity=0)
evaluator = sp.ev.ProbesetEvaluator(adata, verbosity=0, results_dir=None, scheme="custom", metrics=["forest_clfs"])
for set_id, df in selections.items():
    gene_set = df[df["selection"]].index.to_list()
    evaluator.evaluate_probeset(gene_set, set_id=set_id)

evaluator.plot_confusion_matrix()
../_images/Evaluator_plot_confusion_matrix.png