cascade.metrics.ctfact_dir_acc

cascade.metrics.ctfact_dir_acc(ctrl, true, pred, by, top_de=None, exclude_self=False, de_key='rank_genes_groups')[source]

Directional accuracy of counterfactual predictions

Parameters:
  • ctrl (AnnData) – Control dataset

  • true (AnnData) – True interventional effect dataset

  • pred (AnnData) – Predicted counterfactual effect dataset

  • by (str) – Intervention variable to group by in the obs slot

  • top_de (int) – Number of top differentially expressed genes to consider

  • exclude_self (bool) – Whether to exclude the perturbed genes themselves

  • de_key (str) – Key to the differential expression results

Return type:

DataFrame

Returns:

Counterfactual metric data frame containing column “dir_acc”