Error using cross validation with plsregress

6 ビュー (過去 30 日間)
bruno ebel
bruno ebel 2020 年 9 月 23 日
コメント済み: bruno ebel 2020 年 9 月 29 日
Hi everyone,
I am running a PLS regression and try to perform cross validation (k-fold) with matlab data.
load spectra
X = NIR;
y = octane;
[XL,yl,XS,YS,beta,PCTVAR,MSE] = plsregress(X,y,10,'CV',10);
Unfortunately, this error appear:
Could you explain to me how to solve it please?
Thank you in advance for your help.
Bruno
  4 件のコメント
bruno ebel
bruno ebel 2020 年 9 月 24 日
Ok, i've changed the order of the folder in the set up. Thanks again :-)
bruno ebel
bruno ebel 2020 年 9 月 24 日
But errors are still here...

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2020 年 9 月 24 日
編集済み: Adam Danz 2020 年 9 月 28 日
Based on the results of
which crossval -all
a function with the same name from a 3rd party toolbox (pls toolbox) is shadowing Matlab's crossval function which is called by plsregress.
If you are not using the pls toolbox, remove it from your Matlab path using
rmpath('C:\Program Files\MATLAB\R2017a\toolbox\pls_toolbox_862')
% or
rmpath([matlabroot, '\toolbox\pls_toolbox_862'])
If you are using the pls toolbox, you can use Julian's answer explained here
It grabs the function handle from Matlab's crossval function and assigns it to a variable that you can use in addition to the crossval version in pls toolbox.
  3 件のコメント
Adam Danz
Adam Danz 2020 年 9 月 25 日
編集済み: Adam Danz 2020 年 9 月 28 日
In the past when I faced the same problem I used Julian's answer explained here
I'll update my answer to include this.
bruno ebel
bruno ebel 2020 年 9 月 29 日
ok thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by