zoom.pls_tool.optimal_component_eval

zoom.pls_tool.optimal_component_eval(expression: pandas.DataFrame, SBP: pandas.DataFrame, ncomps: numpy.ndarray | list, cv: int, seed: int) Tuple[list, list, pandas.DataFrame][source]

Evaluate optimal component for PLS-R through cross-validation strategy.

Parameters:
  • expression (pd.DataFrame) – AHBA gene expression matrix.

  • SBP (pd.DataFrame) – One-dimensional data frame of spatial brain phenotype.

  • ncomps (np.ndarray or list) – Optimal component number candidates.

  • cv (int) – Number of folds in cross-validation.

  • seed (int) – Random seed to control the dataset split.

Returns:

  • best_comps & r (list) – Local optimal component numbers during the current dataset splition and the corresponding Pearson’s correlation between the predicted SBP and actual SBP.

  • preds (pd.DataFrame) – Predictions of cross-validation PLS-R.

References

Wang, Y. et al. Spatio-molecular profiles shape the human cerebellar hierarchy along the sensorimotor-association axis. Cell Rep. 43, 113770 (2024).