nispace.stats.coloc.fast_pls1

nispace.stats.coloc.fast_pls1(x, y, n_components)[source]

Fast PLS via the SIMPLS algorithm for a single target.

Numba-accelerated (_simpls1_loop); matches sklearn.cross_decomposition.PLSRegression output with ~5x speed-up. This is the implementation NiSpace’s colocalize(method=”pls”) actually calls (not the plain sklearn-based pls function above). Implements SIMPLS [38].

Parameters:
  • x ((n_samples, n_features) array_like) – Does not handle NaN – callers must pre-mask.

  • y ((n_samples,) or (n_samples, 1) array_like) –

  • n_components (int) – Number of latent components.

Returns:

  • coef ((n_features,) ndarray) – Regression weights in original data units.

  • intercept (float)

  • r2 (float) – Coefficient of determination.

  • x_loadings ((n_features, n_components) ndarray) – Same meaning as PLSRegression.x_loadings_ from scikit-learn.

References

[38].