nispace.stats.coloc.pls

nispace.stats.coloc.pls(x, y, n_components=inf, **kwargs)[source]

Partial least squares regression of x on y via scikit-learn’s NIPALS PLSRegression.

Parameters:
  • x (np.ndarray, shape (n_obs, n_predictors)) – Does not handle NaN – sklearn errors on NaN input; pre-mask.

  • y (np.ndarray, shape (n_obs,) or (n_obs, 1)) –

  • n_components (int, default np.inf) – Number of latent components; clipped to n_predictors if larger.

  • **kwargs – Forwarded to sklearn.cross_decomposition.PLSRegression.

Returns:

out"r2" (float), "beta" (shape (n_predictors,)), "loadings" (reg.x_loadings_).

Return type:

dict

Notes

Reference/cross-check implementation only – NiSpace’s colocalize(method=”pls”) actually calls fast_pls1 (a numba SIMPLS implementation, ~5x faster), not this function.