Fast Partition-Based Cross-Validation With Centering and Scaling for X T X $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$

IF 2.3 4区 化学 Q1 SOCIAL WORK Journal of Chemometrics Pub Date : 2025-03-13 DOI:10.1002/cem.70008
Ole-Christian Galbo Engstrøm, Martin Holm Jensen
{"title":"Fast Partition-Based Cross-Validation With Centering and Scaling for \n \n \n \n \n X\n \n \n T\n \n \n X\n \n $$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{X} $$\n and \n \n \n \n \n X\n \n \n T\n \n \n Y\n \n $$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{Y} $$","authors":"Ole-Christian Galbo Engstrøm,&nbsp;Martin Holm Jensen","doi":"10.1002/cem.70008","DOIUrl":null,"url":null,"abstract":"<p>We present algorithms that substantially accelerate partition-based cross-validation for machine learning models that require matrix products <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>X</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{X} $$</annotation>\n </semantics></math> and <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>Y</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{Y} $$</annotation>\n </semantics></math>. Our algorithms have applications in model selection for, for example, principal component analysis (PCA), principal component regression (PCR), ridge regression (RR), ordinary least squares (OLS), and partial least squares (PLS). Our algorithms support all combinations of column-wise centering and scaling of <span></span><math>\n <semantics>\n <mrow>\n <mi>X</mi>\n </mrow>\n <annotation>$$ \\mathbf{X} $$</annotation>\n </semantics></math> and <span></span><math>\n <semantics>\n <mrow>\n <mi>Y</mi>\n </mrow>\n <annotation>$$ \\mathbf{Y} $$</annotation>\n </semantics></math>, and we demonstrate in our accompanying implementation that this adds only a manageable, practical constant over efficient variants without preprocessing. We prove the correctness of our algorithms under a fold-based partitioning scheme and show that the running time is independent of the number of folds; that is, they have the same time complexity as that of computing <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>X</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{X} $$</annotation>\n </semantics></math> and <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>Y</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{Y} $$</annotation>\n </semantics></math> and space complexity equivalent to storing <span></span><math>\n <semantics>\n <mrow>\n <mi>X</mi>\n <mo>,</mo>\n <mspace></mspace>\n <mi>Y</mi>\n <mo>,</mo>\n <mspace></mspace>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>X</mi>\n </mrow>\n <annotation>$$ \\mathbf{X},\\mathbf{Y},{\\mathbf{X}}^{\\mathbf{T}}\\mathbf{X} $$</annotation>\n </semantics></math>, and <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>Y</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{Y} $$</annotation>\n </semantics></math>. Importantly, unlike alternatives found in the literature, we avoid data leakage due to preprocessing. We achieve these results by eliminating redundant computations in the overlap between training partitions. Concretely, we show how to manipulate <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>X</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{X} $$</annotation>\n </semantics></math> and <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>Y</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{Y} $$</annotation>\n </semantics></math> using only samples from the validation partition to obtain the preprocessed training partition-wise <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>X</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{X} $$</annotation>\n </semantics></math> and <span></span><math>\n <semantics>\n <mrow>\n <msup>\n <mrow>\n <mi>X</mi>\n </mrow>\n <mrow>\n <mi>T</mi>\n </mrow>\n </msup>\n <mi>Y</mi>\n </mrow>\n <annotation>$$ {\\mathbf{X}}^{\\mathbf{T}}\\mathbf{Y} $$</annotation>\n </semantics></math>. To our knowledge, we are the first to derive correct and efficient cross-validation algorithms for any of the 16 combinations of column-wise centering and scaling, for which we also prove only 12 give distinct matrix products.</p>","PeriodicalId":15274,"journal":{"name":"Journal of Chemometrics","volume":"39 3","pages":""},"PeriodicalIF":2.3000,"publicationDate":"2025-03-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://onlinelibrary.wiley.com/doi/epdf/10.1002/cem.70008","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Chemometrics","FirstCategoryId":"92","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/cem.70008","RegionNum":4,"RegionCategory":"化学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"SOCIAL WORK","Score":null,"Total":0}
引用次数: 0

Abstract

We present algorithms that substantially accelerate partition-based cross-validation for machine learning models that require matrix products X T X $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$ . Our algorithms have applications in model selection for, for example, principal component analysis (PCA), principal component regression (PCR), ridge regression (RR), ordinary least squares (OLS), and partial least squares (PLS). Our algorithms support all combinations of column-wise centering and scaling of X $$ \mathbf{X} $$ and Y $$ \mathbf{Y} $$ , and we demonstrate in our accompanying implementation that this adds only a manageable, practical constant over efficient variants without preprocessing. We prove the correctness of our algorithms under a fold-based partitioning scheme and show that the running time is independent of the number of folds; that is, they have the same time complexity as that of computing X T X $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$ and space complexity equivalent to storing X , Y , X T X $$ \mathbf{X},\mathbf{Y},{\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ , and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$ . Importantly, unlike alternatives found in the literature, we avoid data leakage due to preprocessing. We achieve these results by eliminating redundant computations in the overlap between training partitions. Concretely, we show how to manipulate X T X $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$ using only samples from the validation partition to obtain the preprocessed training partition-wise X T X $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$ . To our knowledge, we are the first to derive correct and efficient cross-validation algorithms for any of the 16 combinations of column-wise centering and scaling, for which we also prove only 12 give distinct matrix products.

Abstract Image

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
求助全文
约1分钟内获得全文 去求助
来源期刊
Journal of Chemometrics
Journal of Chemometrics 化学-分析化学
CiteScore
5.20
自引率
8.30%
发文量
78
审稿时长
2 months
期刊介绍: The Journal of Chemometrics is devoted to the rapid publication of original scientific papers, reviews and short communications on fundamental and applied aspects of chemometrics. It also provides a forum for the exchange of information on meetings and other news relevant to the growing community of scientists who are interested in chemometrics and its applications. Short, critical review papers are a particularly important feature of the journal, in view of the multidisciplinary readership at which it is aimed.
期刊最新文献
Fast Partition-Based Cross-Validation With Centering and Scaling for X T X $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{X} $$ and X T Y $$ {\mathbf{X}}^{\mathbf{T}}\mathbf{Y} $$ Getting Insights Into Chromatographic Properties of HILIС and Mixed-Mode Homemade Stationary Phases Using Principal Component and Cluster Analyses Can One Recover the Underlying Spectral Data Matrix From a Given Borgen Plot? Assessing Classification Models of Pharmaceuticals With Conformal Prediction Application of ATR-FTIR Spectrum Combined With Ensemble Learning and Deep Learning for Identification of Amomum tsao-ko at Different Drying Temperatures
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1