# 偏最小二乘判别分析

偏最小二乘判别分析（PLS-DA）是一种有监督分类方法，它对虚拟编码的类别矩阵运行偏最小二乘（PLS）回归，并将连续预测值转换为类别判定。它是高维化学与生物数据最广泛使用的分类器之一，尤其在代谢组学、光谱学和食品真伪鉴别中。<sup>[1](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)</sup><sup> • </sup><sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0003267015001889)</sup> 该方法也以过拟合著称：当特征数多于样本数时，它能凭偶然完美分开随机标记的组，因此交叉验证和置换检验是任何分析中不可或缺的部分。<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup>

| 关键事实 | 详情 |
|---|---|
| 产出什么 | 一条分类规则、样本得分与载荷、预测的虚拟响应，以及用于变量重要性的VIP得分<sup>[4](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)</sup> |
| 核心机制 | 潜变量成分最大化X与类别标签矩阵Y之间的协方差，而PCA只最大化X自身的方差<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup> |
| 等价分类器 | 在单成分且各类样本量相等时，PLS-DA等价于到类质心的欧氏距离；使用全部非零成分时，它等价于线性判别分析<sup>[1](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)</sup> |
| 过拟合阈值 | 当特征数显著超过样本数时，PLS-DA能找到完美分开随机标记组的超平面；组学数据集可超过1:1000<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup> |
| 必需的验证 | 交叉验证误差（\( Q^{2} \)）、置换检验，以及交叉验证而非拟合的得分图<sup>[5](https://link.springer.com/article/10.1007/s11306-007-0099-6)</sup><sup> • </sup><sup>[6](https://www.mdpi.com/2218-1989/10/7/278)</sup> |
| 变量选择 | 通常将\( \text{VIP} > 1 \)的特征视为重要性高于平均水平<sup>[4](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)</sup> |
| 主要软件 | R包pls、mixOmics和ropls，以及商业软件SIMCA<sup>[7](https://rdrr.io/cran/pls/f/inst/doc/pls-manual.Rmd)</sup><sup> • </sup><sup>[8](https://rdrr.io/bioc/mixOmics/man/splsda.html)</sup><sup> • </sup><sup>[9](https://bioc-release.r-universe.dev/ropls/doc/manual.html)</sup> |

## 工作原理

PLS-DA在其第一成分中尽可能多地保留数据矩阵X与类别标签之间的协方差，而PCA保留的是X自身的方差。<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup> 第一成分可写成\( C = \frac{1}{(n-1)^{2}} X^{T} \cdot C_{n} \cdot y \cdot y^{T} \cdot C_{n} \cdot X \)的特征向量，其中\( y \)是类别标签向量；随后的每个成分\( h \)在前几个成分留下的残差矩阵上最大化\( \text{cov}(X_{h} \cdot a_{h}, y_{h} \cdot b_{h}) \)。<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup> 实践中，该方法在X与独热编码的y（两类时为简单的0或1）之间执行PLS2分解，然后在投影空间中对样本进行分类。<sup>[10](https://pychemauth.readthedocs.io/en/latest/jupyter/learn/plsda.html)</sup> 一个有用的心智模型是朝Y轴旋转的PCA。<sup>[4](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)</sup>

得分和载荷的选择是为了尽可能描述X与Y之间的协方差，而主成分回归只关注X的方差。<sup>[7](https://rdrr.io/cran/pls/f/inst/doc/pls-manual.Rmd)</sup> 对于样本量相等的两类，一个PLS成分给出的分类等价于到类质心的欧氏距离，而使用全部非零成分给出的结果等价于线性判别分析。<sup>[1](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)</sup> 拟合模型返回得分（样本×成分）、载荷（特征×成分）、VIP得分，以及拟合统计量R²X、R²Y和Q²，其中最后一个是交叉验证的、更诚实的度量。<sup>[4](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)</sup>

## 实施方法

典型工作流程如下。首先，将类别标签编码为虚拟矩阵Y，多类时用独热编码，两类时用0/1。<sup>[10](https://pychemauth.readthedocs.io/en/latest/jupyter/learn/plsda.html)</sup> 其次，拟合PLS2并获得预测的虚拟响应；一种已发表的多类处理方法用PCA将这些预测投影到\( (k-1) \)维空间，并在该空间中执行分类。<sup>[10](https://pychemauth.readthedocs.io/en/latest/jupyter/learn/plsda.html)</sup><sup> • </sup><sup>[11](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.3030)</sup> 类别归属可以使用得分空间中最近的类质心、阈值、统计置信边界，或投影空间中的逻辑回归边界。<sup>[10](https://pychemauth.readthedocs.io/en/latest/jupyter/learn/plsda.html)</sup>

潜变量成分的数量通过交叉验证选择。R包pls提供“CV”或“LOO”验证，以及自动选择方法，例如一倍标准差启发式，它选择与最佳模型相差一个标准误以内的最少成分。<sup>[7](https://rdrr.io/cran/pls/f/inst/doc/pls-manual.Rmd)</sup> 分类质量用灵敏度、特异度和效率等品质因数评估，这些指标也指导模型复杂度。<sup>[11](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.3030)</sup> 最后是验证：交叉验证不当的模型会给出过于乐观的结果，因此使用置换检验——即随机置换类别标签并重建模型——来检查未置换的结果是否位于零分布的95%或99%置信边界之外。<sup>[5](https://link.springer.com/article/10.1007/s11306-007-0099-6)</sup> 类别分离应基于预测值而非得分等拟合值来判断，<sup>[5](https://link.springer.com/article/10.1007/s11306-007-0099-6)</sup> 仅凭训练集上的R²Y并不能证明预测有效性，因此应报告经过适当交叉验证的性能或外部性能；Q²应进行置换检验，例如进行1000次标签置换。<sup>[4](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)</sup>

## 起源

已发表文献中最早识别出的基于PLS的判别是迈克尔·舍斯特伦（Michael Sjöström）、斯万特·沃尔德（Svante Wold）和本特·瑟德斯特伦（Bengt Söderström）于1986年发表的PLS判别图。<sup>[12](https://doi.org/10.1016/b978-0-444-87877-9.50042-x)</sup> 早期应用是约翰·戈特弗里斯（Johan Gottfries）、卡伊·布伦诺（Kaj Blennow）、安德斯·瓦林（Anders Wallin）和C.G.戈特弗里斯（C.G. Gottfries）于1995年对痴呆的诊断。<sup>[13](https://doi.org/10.1159/000106926)</sup> 统计形式化出现较晚：马修·巴克（Matthew Barker）和威廉·雷恩斯（William Rayens）在2003年《化学计量学杂志》的一篇论文中解释了用于判别的PLS。<sup>[14](https://doi.org/10.1002/cem.785)</sup> 该方法建立在保罗·杰拉迪（Paul Geladi）和布鲁斯·R·科瓦尔斯基（Bruce R. Kowalski）1986年发表于《分析化学学报》的教程，以及斯万特·沃尔德、迈克尔·舍斯特伦和伦纳特·埃里克松（Lennart Eriksson）2001年的综述所记录的PLS回归传统之上。<sup>[15](https://doi.org/10.1016/0003-2670%2886%2980028-9)</sup><sup> • </sup><sup>[16](https://doi.org/10.1016/s0169-7439%2801%2900155-1)</sup> 西伊门·德容（Sijmen de Jong）1993年发表于《化学计量学与智能实验室系统》的SIMPLS算法，为拟合PLS模型提供了一种计算高效的替代方案。<sup>[17](https://doi.org/10.1016/0169-7439%2893%2985002-x)</sup> 2025年的一篇论文指出，偏最小二乘可处理描述变量多于观测值的情形。<sup>[18](https://doi.org/10.1021/acs.jcim.4c01799)</sup> 到2014年，该方法已可用近20年，但大多数用户仍对其理解甚少。<sup>[1](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)</sup>

## 变体

**OPLS-DA。** 潜结构正交投影（O-PLS）由约翰·特里格（Johan Trygg）和斯万特·沃尔德于2002年发表。<sup>[19](https://doi.org/10.1002/cem.695)</sup> 结合PLS-DA与SIMCA分类优势的OPLS判别分析，由马克斯·比莱舍（Max Bylesjö）及其同事于2006年发表在《化学计量学杂志》上。<sup>[20](https://doi.org/10.1002/cem.1006)</sup> OPLS将X的变异分离为与Y相关的预测部分和与Y不相关的正交部分，从而简化解释；它本质上是一种两组方法，因此对于三类或更多类，实践者使用成对OPLS-DA或带指示变量的标准PLS-DA。<sup>[18](https://doi.org/10.1021/acs.jcim.4c01799)</sup><sup> • </sup><sup>[4](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)</sup>

**稀疏与多类变体。** 稀疏偏最小二乘判别分析（sPLS-DA）由金-安·黎高（Kim-Anh Lê Cao）、西蒙·布瓦塔尔（Simon Boitard）和菲利普·贝斯（Philippe Besse）于2011年发表在《BMC生物信息学》上，它加入Lasso \( \ell_{1} \) 惩罚，使特征选择与分类一步完成；必须调节两个参数：维数\( H \)（通常为\( K-1 \)，如LDA中那样）和每个维度选择的变量数。<sup>[21](https://doi.org/10.1186/1471-2105-12-253)</sup><sup> • </sup><sup>[22](https://pmc.ncbi.nlm.nih.gov/articles/PMC3133555/)</sup> 对于多类问题，阿列克谢·L·波梅兰采夫（Alexey L. Pomerantsev）和奥克萨娜·Ye·罗季奥诺娃（Oxana Ye. Rodionova）于2018年提出了一种完全基于预测虚拟响应而非PLS得分的理论，包括传统的硬PLS-DA和新引入的软PLS-DA。<sup>[11](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.3030)</sup> 软PLS-DA通过马氏距离\( d_{ik} = (t_i - c_k) \cdot S_k^{-1} \cdot (t_i - c_k)^{T} \)与来自卡方分位数的临界距离\( d_{\rm crit} = \chi^{-2}(1-\alpha, k-1) \)比较来分类；一个样本可以被归入一个类、多个类或不属于任何类，这适合真伪鉴别研究。<sup>[10](https://pychemauth.readthedocs.io/en/latest/jupyter/learn/plsda.html)</sup> 2025年，埃德温·福斯格伦（Edvin Forsgren）、本尼·比约克布洛姆（Benny Björkblom）、约翰·特里格和佩尔·约恩松（Pär Jonsson）引入了OPLS-HDA，它构建成对OPLS-DA模型的自上而下决策树，总共\( N(N-1)/2 \)个模型，并使用交叉验证预测上的Cohen's d作为可分性度量；这解决了在“一对其余”方法下类别数增加时PLS和OPLS-DA所遭受的可解释性和预测能力损失。<sup>[18](https://doi.org/10.1021/acs.jcim.4c01799)</sup>

**软件。** R包pls实现三种PLS算法：用于高矩阵的核算法、经典正交得分（NIPALS）算法和SIMPLS。<sup>[7](https://rdrr.io/cran/pls/f/inst/doc/pls-manual.Rmd)</sup> mixOmics包的splsda()函数默认ncomp = 2、scale = TRUE，keepX设置每个成分保留的变量。<sup>[8](https://rdrr.io/bioc/mixOmics/man/splsda.html)</sup> ropls包实现PCA、PLS(-DA)和OPLS(-DA)，并内置交叉验证和置换检验。<sup>[9](https://bioc-release.r-universe.dev/ropls/doc/manual.html)</sup> PLS-DA被认为具有的优势包括可在R、SAS、SPSS和MATLAB等常用软件包中使用、默认实现简单，以及对高度共线和含噪数据的容忍性。<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0003267015001889)</sup>

## 应用

过去二十年中，PLS-DA已广泛应用于食品分析中的产品真伪鉴别、医学诊断中的疾病分类，以及法医学中的证据分析。<sup>[23](https://pubs.rsc.org/en/content/articlelanding/2018/an/c8an00599k)</sup> 在代谢组学中，它是分类和回归最著名的工具，以至于一些研究者不知道还有其他多元分类器；2025年的一篇教程确认，PLS-DA和OPLS-DA很可能仍是代谢组学中最常用的分类方法。<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0003267015001889)</sup><sup> • </sup><sup>[24](http://biospec.net/pdfs/Xu-TrAC2025.pdf)</sup> 除预测之外，该方法在探索性分析中仍具有独特作用：其权重和载荷揭示哪些变量（例如特定代谢物或光谱峰）导致了类别之间的区分。<sup>[1](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)</sup>

## 局限性与替代方法

**过拟合。** 当变量数显著超过样本数时，模型很可能凭偶然实现良好分类。<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0003267015001889)</sup> 模拟表明，校准后的PLS-DA和OPLS-DA得分图可以显示完美分离，而交叉验证图和测试集图却显示大量重叠，且\( R^{2} \)远大于\( Q^{2} \)；使用交叉验证得分可解决该问题，作者建议拒绝那些展示校准得分图的论文，除非\( R^{2} \)和\( Q^{2} \)大小相当。<sup>[6](https://www.mdpi.com/2218-1989/10/7/278)</sup> OPLS-DA的过拟合程度至少与PLS-DA相当，在成分很多时可能更严重。<sup>[6](https://www.mdpi.com/2218-1989/10/7/278)</sup> 每篇使用PLS-DA的论文都应报告交叉验证误差，才具有任何有效性。<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup> 不应使用得分图推断类别差异，因为它们呈现过于乐观的分离视图，即使对随机分配的标签也是如此。<sup>[5](https://link.springer.com/article/10.1007/s11306-007-0099-6)</sup>

**\( Q^{2} \)不是安全标准。** 在UPLC-MS数据上，即使叠加了真实效应，PLS-DA的\( Q^{2} \)值也接近0，因此“\( Q^{2} \)高于0.5可接受、负\( Q^{2} \)意味着过拟合”的临时规则有假阴性风险；过拟合应通过同时考虑较大的\( R^{2} \)–\( Q^{2} \)差距来判断，而正确分类率或基于AUROC的模型选择优于基于\( Q^{2} \)的潜变量选择。<sup>[24](http://biospec.net/pdfs/Xu-TrAC2025.pdf)</sup>

**比较。** 在具有现实伪影（非正态误差、分配不平衡、离群值、缺失值）的模拟场景中，分类器准确率从最好到最差排序为：SVM、随机森林、朴素贝叶斯、sPLS-DA、神经网络、PLS-DA和k-NN；PLS-DA在非正态误差、离群值和缺失值下的性能退化尤为明显，而正则化（sPLS-DA）在提高准确率的同时产生更稀疏的分类器。<sup>[25](https://pmc.ncbi.nlm.nih.gov/articles/PMC5488001/)</sup> 布鲁尔顿（Brereton）和劳埃德（Lloyd）得出结论：就分类目的而言，PLS-DA相比传统程序没有显著优势，并称其为“一个充满危险的算法”。<sup>[1](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)</sup> 当类别在信号特征上形成簇时，PLS-DA效果良好；但当类别由线性或非线性关系定义时，它提供的洞见很少。<sup>[3](https://link.springer.com/article/10.1186/s12859-019-3310-7)</sup> \( \text{VIP} > 1 \)是候选变量的实用筛选阈值，应结合倍数变化、校正p值、注释质量和通路合理性进行核查，而不应将其视为生物学定律。<sup>[26](https://www.metwarebio.com/pls-da-metabolomics-guide/)</sup> 实践者指南建议，每类少于约五个生物学重复所构建的模型应视为探索性模型，而每类十个或更多重复才是发现阶段更站得住脚的起点。

## References

1. [Partial least squares discriminant analysis: taking the magic away (Brereton & Lloyd, Journal of Chemometrics, 2014)](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.2609)
2. [A tutorial review: Metabolomics and partial least squares-discriminant analysis – a marriage of convenience or a shotgun wedding (Gromski et al., Analytica Chimica Acta, 2015)](https://www.sciencedirect.com/science/article/abs/pii/S0003267015001889)
3. [So you think you can PLS-DA? (BMC Bioinformatics, 2019)](https://link.springer.com/article/10.1186/s12859-019-3310-7)
4. [Multivariate discrimination with PLS-DA and OPLS-DA (OmicVerse tutorial)](https://omicverse.readthedocs.io/en/stable/Tutorials-metabol/t_metabol_02_multivariate.html)
5. [Assessment of PLSDA cross validation (Westerhuis et al., Metabolomics, 2008)](https://link.springer.com/article/10.1007/s11306-007-0099-6)
6. [Can We Trust Score Plots? (Metabolites, 2020)](https://www.mdpi.com/2218-1989/10/7/278)
7. [pls package manual (R, CRAN)](https://rdrr.io/cran/pls/f/inst/doc/pls-manual.Rmd)
8. [splsda: Sparse Partial Least Squares Discriminant Analysis (sPLS-DA) in mixOmics, R documentation](https://rdrr.io/bioc/mixOmics/man/splsda.html)
9. [Package 'ropls' reference manual](https://bioc-release.r-universe.dev/ropls/doc/manual.html)
10. [PLS-DA documentation (pyChemAuth readthedocs)](https://pychemauth.readthedocs.io/en/latest/jupyter/learn/plsda.html)
11. [Multiclass partial least squares discriminant analysis: Taking the right way, A critical tutorial (Pomerantsev & Rodionova, Journal of Chemometrics, 2018)](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.3030)
12. [Michael Sjöström, Svante Wold, Bengt Söderström (1986). PLS DISCRIMINANT PLOTS. Elsevier eBooks.](https://doi.org/10.1016/b978-0-444-87877-9.50042-x)
13. [Johan Gottfries and colleagues (1995). Diagnosis of Dementias Using Partial Least Squares Discriminant Analysis. Dementia and Geriatric Cognitive Disorders.](https://doi.org/10.1159/000106926)
14. [Matthew Barker, William Rayens (2003). Partial least squares for discrimination. Journal of Chemometrics.](https://doi.org/10.1002/cem.785)
15. [Partial least-squares regression: a tutorial (Analytica Chimica Acta, 1986)](https://doi.org/10.1016/0003-2670%2886%2980028-9)
16. [PLS-regression: a basic tool of chemometrics (Chemometrics and Intelligent Laboratory Systems, 2001)](https://doi.org/10.1016/s0169-7439%2801%2900155-1)
17. [SIMPLS: An alternative approach to partial least squares regression (Chemometrics and Intelligent Laboratory Systems, 1993)](https://doi.org/10.1016/0169-7439%2893%2985002-x)
18. [Edvin Forsgren and colleagues (2025). OPLS-Based Multiclass Classification and Data-Driven Interclass Relationship Discovery. Journal of Chemical Information and Modeling.](https://doi.org/10.1021/acs.jcim.4c01799)
19. [Johan Trygg, Svante Wold (2002). Orthogonal projections to latent structures (O‐PLS). Journal of Chemometrics.](https://doi.org/10.1002/cem.695)
20. [Max Bylesjö and colleagues (2006). OPLS discriminant analysis: combining the strengths of PLS‐DA and SIMCA classification. Journal of Chemometrics.](https://doi.org/10.1002/cem.1006)
21. [Kim-Anh Lê Cao, Simon Boitard, Philippe Besse (2011). Sparse PLS discriminant analysis: biologically relevant feature selection and graphical displays for multiclass problems. BMC Bioinformatics.](https://doi.org/10.1186/1471-2105-12-253)
22. [Sparse PLS discriminant analysis: biologically relevant feature selection and graphical displays for multiclass problems (Lê Cao et al., BMC Bioinformatics, 2011)](https://pmc.ncbi.nlm.nih.gov/articles/PMC3133555/)
23. [Partial least squares-discriminant analysis (PLS-DA) for classification of high-dimensional (HD) data: a review of contemporary practice strategies and knowledge gaps (Lee, Liong & Jemain, Analyst, 2018)](https://pubs.rsc.org/en/content/articlelanding/2018/an/c8an00599k)
24. [Mind your Ps and Qs – Caveats in metabolomics data analysis (TrAC, 2025; author-hosted copy)](http://biospec.net/pdfs/Xu-TrAC2025.pdf)
25. [Evaluation of Classifier Performance for Multiclass Phenotype Discrimination in Untargeted Metabolomics (PMC, 2017)](https://pmc.ncbi.nlm.nih.gov/articles/PMC5488001/)
26. [PLS-DA in Metabolomics: Principles, Workflow, Interpretation, and Best Practices (MetwareBio, recent guide)](https://www.metwarebio.com/pls-da-metabolomics-guide/)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 25, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles Mo to W

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/partial-least-squares-discriminant-analysis

English original: https://www.edgepedia.org/partial-least-squares-discriminant-analysis
