Closed rexdeng closed 2 years ago
Hi, looks weird and I can not reproduce the problem with my data.
I can suggest to run the iPLS using full cross-validation. By default ipls()
uses systematic split into 10 segments (venetian blinds) but you have only 14 measurements, it is too small for segmented cross-validation, so try to add: cv = 1
to you ipls call.
Have not heard anything from you since that, so I am closing the issue.
Train dataset contains 14 concentrations and corresponding NIR spectra (14×1037). I wrote the following codes. library(mdatools) x=spec y=conc m=ipls(x,y,int.num = 200)
But when I run the code, I get an error: Error: Local model inside cross-validation can not be computed with the same number of components as used for calibration. Limit the number by using parameter 'ncomp' and run the code again. When I adjust some parameters (m=ipls(x,y,glob.ncomp = 3,int.num = 200,ncomp=3)), the following error message appears: Error in selectCompNum.pls(model, selcrit = ncomp.selcrit) : Can not estimate correct number of PLS components. What went wrong?