cascade.model.CASCADE.design_error_curve

CASCADE.design_error_curve(source, target, design, n_steps=500, n_cells=100, confidence_level=0.95, stratify=None, batch_size=128, n_devices=1)[source]

Fit an error curve against design scores

Parameters:
  • source (AnnData) – Source dataset

  • target (AnnData) – Target dataset representing desired outcome

  • design (IntervDesign) – Intervention design module from design()

  • n_steps (int) – Number of equidistant score steps

  • n_cells (int) – Number of cells per design

  • confidence_level (float) – Confidence level

  • stratify (str | None) – Column name in obs for stratified random pairing

  • batch_size (int) – Batch size

  • n_devices (int) – Number of GPU devices to use

Return type:

tuple[DataFrame, float]

Returns:

  • DataFrame of design error curve containing the following columns

    • “score”: Design score

    • ”mse_est”: Weighted MSE estimate at equidistant steps

    • ”mse_est_mean”: Smoothed weighted MSE estimate

    • ”mse_est_lower”: Lower bound of the confidence interval

    • ”mse_est_upper”: Upper bound of the confidence interval

    Indexed by intervention and sorted by descending scores

  • Design score cutoff that covers minimal MSE in the confidence interval