Error using cross validation with plsregress
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
bruno ebel
el 23 de Sept. de 2020
Comentada: bruno ebel
el 29 de Sept. de 2020
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 comentarios
Respuesta aceptada
Adam Danz
el 24 de Sept. de 2020
Editada: Adam Danz
el 28 de Sept. de 2020
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.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!