opls — Orthogonal PLS (OPLS)

Group: Core PLS · Registry tolerance: 1e-08

Description

Orthogonal PLS (Trygg & Wold 2002)

Registry note — Bioconductor ropls::opls is the external OPLS reference; convergence and orthogonal-component conventions may differ.

Parameters

Name

Type

Default

Notes

n_components

int

4

registry benchmark cell value

Explanations

Bibliographic source

Trygg, J. & Wold, S. (2002). Orthogonal projections to latent structures (O-PLS). Journal of Chemometrics 16(3), 119–128. DOI 10.1002/cem.695.

Mathematical principle

OPLS rotates the standard PLS latent space so that a single direction captures all \(\mathbf{Y}\)-correlated variation while the remaining components capture \(\mathbf{Y}\)-orthogonal structural variation in \(\mathbf{X}\). The resulting decomposition \(\mathbf{X} = \mathbf{t}_p\mathbf{p}_p^{\top} + \mathbf{T}_o\mathbf{P}_o^{\top} + \mathbf{E}\) separates the predictive component \(\mathbf{t}_p\) from the orthogonal block \(\mathbf{T}_o\), which absorbs spectroscopic baselines, scatter and other nuisance factors that confound interpretation of the predictive loading.

Numerically OPLS proceeds by NIPALS-deflating \(\mathbf{X}\) against directions orthogonal to \(\mathbf{X}^{\top}\mathbf{y}\) before each new predictive component is extracted. Predictions are identical to those of a one-component PLS on the orthogonal-corrected \(\mathbf{X}\); the value is in the interpretation of the loadings, not in better predictions per se.

OPLS shines in metabolomics and process spectroscopy where the spectra carry strong systematic but non-predictive variation; in those settings the single-vector predictive loading is far easier to relate to biology / chemistry than a multi-component PLS loading matrix.

Appropriate uses

Separating X variation correlated with Y from orthogonal spectral variation for interpretation and linear prediction.

Limits and validation

Orthogonal filtering is supervised and must be fitted inside each validation fold; it does not make the final predictor nonlinear.

Implementation

Algorithm.OPLS + Solver.NIPALS + Deflation.ORTHOGONAL. Reference: Bioconductor ropls::opls. Note: orthogonal-component ordering and the criterion that stops orthogonal extraction differ between implementations — exact bit parity is not expected, but RMSE-rel parity within ~1e-3 is.

Sources and provenance

Current implementation: cpp/src/core/extra_pls.cpp.

API and bindings

C ABI: no standalone exported symbol is declared for this method.

Python: no current AST-verified public n4m re-export was found for this method. The linked C ABI above is the documented surface in this checkout.

R: no current source-verified entry point was found for this catalog method.

MATLAB / Octave: no current source-verified entry point was found for this catalog method.

Registry parity references 📐

  • 📐 ref.r_ropls (R · r) — ropls Bioc · strict (rmse_rel ≤ 1e-08) — Bioconductor ropls::opls — OPLS reference. Permutations and plotting are disabled in benchmark timing; ropls still requires crossvalI >= 1 for a finite Q2 path.

Benchmarks

Archived measurement identity. Backend labels in this table are the raw IDs recorded when the benchmark ran (including historical pls4all.* IDs). They preserve measurement provenance and do not describe a current public Python, R, or MATLAB binding; use the source-verified API and bindings section above for current entry points.

Adaptive wall-clock per cell measured against full_matrix.csv. Only backends that implement this method are listed; libraries without the method are omitted.

Verdict  ·  ✓ ref / ≈ ref / ~ shape mark a reference-gate pass at strict / relaxed / qualitative tolerance  ·  ✓ bind = archived binding-harness result agrees with the C++ baseline  ·  ⇄ cross-check = documented by-design selector/RNG/model, noncanonical API/facade convention, or secondary oracle  ·  ✗ divergent  ·  ⚠ error  ·  — not run. The fastest backend per column is marked 🏆.

Reference gate: strict — numeric equivalence (rmse_rel_tol ≤ 1e-08).

Rows tagged with 📐 are the canonical parity references for this method (declared in parity_timing.registry). C++ and external rows show reference parity; archived language-harness rows show binding parity against the C++ backend. Hover the icon for role and tolerance band.

BackendParity200×50 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ ref 5e-151.87 ms🏆
Python · archived pls4all benchmark
pls4all.python✓ bind1.88 ms
pls4all.sklearn✓ bind2.12 ms
R · archived pls4all benchmark
pls4all.R✓ 2e-144.35 ms
pls4all.R.formula✓ 2e-145.13 ms
pls4all.R.mdatools✓ 2e-145.23 ms
pls4all.R.pls✓ 2e-145.40 ms
R · external
📐ref.r_roplssource15.4 ms
BackendParity200×50 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ ref 5e-151.96 ms
Python · archived pls4all benchmark
pls4all.python✓ bind1.79 ms🏆
pls4all.sklearn✓ bind2.14 ms
R · archived pls4all benchmark
pls4all.R✓ 2e-146.22 ms
pls4all.R.formula✓ 2e-145.57 ms
pls4all.R.mdatools✓ 2e-147.12 ms
pls4all.R.pls✓ 2e-147.88 ms
R · external
📐ref.r_roplssource16.0 ms
BackendParity200×50 (ms)
C++ native · libn4m
pls4all.cpp.blas+omp✓ ref 5e-151.73 ms🏆
Python · archived pls4all benchmark
pls4all.python✓ bind1.81 ms
pls4all.sklearn✓ bind1.94 ms
R · archived pls4all benchmark
pls4all.R✓ 2e-144.17 ms
pls4all.R.formula✓ 2e-145.09 ms
pls4all.R.mdatools✓ 2e-145.39 ms
pls4all.R.pls✓ 2e-145.17 ms
R · external
📐ref.r_roplssource16.0 ms

See also: benchmark overview · methods index · interactive dashboard