Method · Statistics Library

Partial least squares (PLS) regression

Partial least squares regression predicts a continuous outcome from constructed components that are built to maximize covariance with the outcome itself, not just predictor variance, usually reaching good predictions with fewer components than principal components regression.

Topic indexA reference reading outside the guided chapter sequence

Understand the idea

PLS solves the same basic problem as principal components regression (too many, or too correlated, predictors) but builds its compressed 'components' in a genuinely smarter way: instead of choosing directions that simply capture the most variation AMONG the predictors (which is what PCA/PCR does, blind to the outcome), PLS chooses directions specifically to capture the most COVARIANCE between the predictors and the outcome you are trying to predict. In plain terms, PLS looks at the answer while building its compressed summary; PCR does not.

Because the very first PLS component is already tilted toward whatever helps predict the outcome, PLS typically needs FEWER components than PCR to reach the same predictive accuracy: the supervised advantage shows up directly as watching how much outcome variance gets front-loaded into the first component or two.

Every predictor also gets a VIP (Variable Importance in Projection) score summarizing how much it contributes across all the retained components, weighted by how much outcome variance each component actually explains. Because these scores are built so that their average squared value is exactly 1, a simple rule of thumb applies: VIP at or above 1 marks an influential predictor, and well below 1 marks a candidate you could probably drop without losing much.

PLS regression builds components chosen to predict the outcome, not just to summarize the predictors. A VIP score summarizes how important each predictor is across the components; values above about 1 are commonly read as important.

Practitioner explanation

KernelStats scales X and Y internally (scale=True) so no predictor dominates by measurement units, and sweeps the component count k=1,2,... choosing by 5-fold cross-validated RMSE (seeded, reproducible) exactly as PCR does; keeping every component drives PLS back toward ordinary least squares, so the value of the method is specifically in stopping early. VIP is computed as VIP_j = sqrt(p * sum_a(SSY_a * (w_ja/||w_a||)^2) / sum_a(SSY_a)), where SSY_a is the outcome variance explained by component a, giving each predictor one importance number that accounts for both how strongly it loads on each component AND how much that component actually mattered for predicting y.

The product states plainly that VIP is an IN-MODEL importance ranking under multicollinearity, NOT a hypothesis test and NOT evidence of causation: a high VIP means a predictor contributes substantially to the components that predict the outcome well, nothing more. As with PCR, there are no classical p-values here: the cross-validation RMSE curve is the evidence for the model, and coefficients (back-transformed to the raw predictor scale) are point predictions, not inferential estimates with a sampling distribution.

The product frames the PCR-vs-PLS choice as a direct decision guide rather than leaving it implicit: PLS wins when the signal genuinely lives in a LOW-variance direction of the predictors that PCR's purely-variance-driven components would discard early; PCR remains preferable when the signal happens to align with the predictors' own high-variance directions anyway, since it is the simpler, unsupervised story in that case. Because PLS explicitly uses y to build its components, overfitting risk is real if too many components are kept or the choice is judged on TRAINING R-squared rather than the cross-validated curve; the product states this as a specific caution, not merely a generic overfitting warning.

When to use it

Consider it when

Predictors are numerous and/or correlated, prediction accuracy is the primary goal, and the direction most related to the outcome may not be the direction of greatest predictor variance (which would make PCR need more components for the same accuracy).

Use caution when

You need classical p-values on individual coefficients (this cross-validated approach does not provide them), or you specifically want components that reflect only the predictors' own structure (unsupervised, like PCR) rather than being shaped by the outcome.

Formulas and symbols

PLS component weight (first component)

w1=arg⁡max⁡∥w∥=1Cov⁡(Xw, y)w_1 = \arg\max_{\|w\|=1} \operatorname{Cov}(Xw,\, y)

Chosen to maximize covariance between the predictor projection and the outcome directly, unlike PCA's purely predictor-variance objective.

Variable Importance in Projection (VIP)

VIPj=p ∑a=1kSSYa(wja/∥wa∥)2∑a=1kSSYa\text{VIP}_j = \sqrt{p\,\dfrac{\sum_{a=1}^{k} SSY_a (w_{ja}/\|w_a\|)^2}{\sum_{a=1}^{k} SSY_a}}

SSY_a the outcome variance explained by component a. VIP scores satisfy mean(VIP^2)=1, so VIP >= 1 marks an influential predictor.

Cross-validated component count selection

k∗=arg⁡min⁡kCV-RMSE(k)k^* = \arg\min_k \text{CV-RMSE}(k)

5-fold cross-validation (seeded); keeping every component reproduces ordinary least squares.

Assumptions and checks

  • PLS's internal scaling assumes predictors and the outcome are placed on comparable scales; without this, components would be dominated by whichever raw variable happens to have the largest variance rather than reflecting genuine shared structure with the outcome.

    In KernelStats: Checked directly: the card confirms X and Y were scaled internally before extracting components, so this is enforced by construction rather than left to the analyst.

  • If the retained components capture only a small share of the outcome's variance, the supervised advantage PLS offers over PCR (steering components toward the outcome) has not actually been realized, and the model may be little better than an unsupervised projection.

    In KernelStats: Checked directly: the card reports the cumulative outcome variance captured by the retained components.

  • If every possible component is retained (no dimension reduction actually applied), the fit reduces to ordinary least squares on the original predictors, and none of PLS's supervised-shrinkage benefit is realized.

    In KernelStats: Checked directly: the card flags the degenerate case where the chosen component count equals the maximum possible (equal to the number of predictors), noting the fit is then numerically identical to OLS.

Alternatives

  • Principal Components Regression. You want components built purely from predictor variance, with no dependence on the outcome shaping the compression.
  • Ridge Regression. You want to stabilize coefficients under multicollinearity without any dimensionality compression step.

Worked example

Scenario

Predicting penguin body mass from three correlated measurements (bill length, bill depth, flipper length) using PLS, component count chosen by 5-fold cross-validation (seed 42), and compared with PCR on the same data.

Result

The first PLS component alone captures 67.9% of the outcome variance; cross-validated RMSE is 457, 400 and 392 g for one, two and three components, against PCR's 475, 471 and 392 g. Cross-validation keeps all three components (so the card flags that the fit equals OLS, R-squared = 0.76). VIP: flipper length 1.28, bill length 0.88, bill depth 0.77.

Interpretation

At every component count below the full set, PLS predicts better than PCR: two PLS components already come within 8 g of the full model's error, while two PCR components barely improve on one. That is the supervised advantage the method is built for. With only three predictors, though, cross-validation still prefers the full model, so there is no compression to report; the VIP scores single out flipper length as the one predictor above 1.

Dataset: penguins.csv

Common misconceptions

Misconception

A predictor with a VIP score above 1 has been proven to causally drive the outcome.

Correction

VIP is an IN-MODEL importance ranking that reflects how much a predictor contributes to the components that best predict the outcome, under whatever multicollinearity is present in this specific dataset; it is not a hypothesis test and carries no causal claim. A high VIP means the model relies on that predictor, nothing more.

Misconception

PLS is just PCA followed by an ordinary regression, the same as PCR.

Correction

That description is exactly PCR, not PLS. The defining difference is that PLS uses the OUTCOME when building its components (maximizing covariance between predictors and y), while PCR's components come from the predictors alone with no reference to y at all, a genuinely different construction, not a naming variant of the same procedure.

References

  1. PLS-regression: a basic tool of chemometrics, Wold, S., Sjostrom, M. and Eriksson, L. (2001), Chemometrics and Intelligent Laboratory Systems, 58(2), 109-130.
  2. An Introduction to Statistical Learning with Applications in R (2nd ed.), Section 6.3.2, James, G., Witten, D., Hastie, T. and Tibshirani, R. (2021).