scib_metrics.pcr_comparison

Contents

scib_metrics.pcr_comparison#

scib_metrics.pcr_comparison(X_pre, X_post, covariate, scale=True, **kwargs)[source]#

Principal component regression (PCR) comparison [Büttner et al., 2018].

Compare the explained variance before and after integration.

Parameters:
  • X_pre (ndarray | Array) – Pre-integration array of shape (n_cells, n_features).

  • X_post (ndarray | Array) – Post-integration array of shape (n_celss, n_features).

  • covariate_pre – Array of shape (n_cells,) or (n_cells, 1) representing batch/covariate values.

  • scale (bool (default: True)) – Whether to scale the score between 0 and 1. If True, larger values correspond to larger differences in variance contributions between X_pre and X_post.

  • kwargs – Keyword arguments passed into principal_component_regression().

Return type:

float

Returns:

pcr_compared: float Principal component regression score comparing the explained variance before and after integration.