Interval PLS (iPLS) coding in R

Hi,

I am using Interval PLS (iPLS) for wavelength selection. There are three types of methods;

1): Backward
2): forward
3): synergy or segmented one

Please see my code below

library(mdatools)

forward_pls<- ipls(x,y,glob.ncomp = 10, int.num = 25)

Backward_pls<- ipls(x,y,glob.ncomp = 10, int.num = 25, method="backward")

and this worked, however, when i am passing synergy or segmented to method it does not work.
Please help me with the coding how to apply segmented PLS in R.

Thanks
Nimra

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

HI Max,

library(mdatools)
data("simdata")

X = simdata$spectra.c
y = simdata$conc.c[, 2, drop = FALSE]

forward = ipls(X, y, glob.ncomp = 4, int.num = 15)

backward = ipls(X, y, glob.ncomp = 4, int.num = 15, method = "backward")

segmented = ipls(X, y, glob.ncomp = 4, int.num = 15, method = "segmented")

#Error in ipls(X, y, glob.ncomp = 4, int.num = 15, method = "segmented") : 
#Wrong value for parameter 'method'.

synergy = ipls(X, y, glob.ncomp = 4, int.num = 15, method = "synergy")

#Error in ipls(X, y, glob.ncomp = 4, int.num = 15, method = "synergy") : 
#Wrong value for parameter 'method'.

I am not sure if we can use ipls to apply segmneted/synery PLS or there is some other package.

You can only use forward and backward:

> segmented = ipls(X, y, glob.ncomp = 4, int.num = 15, method = "segmented")
Error in ipls(X, y, glob.ncomp = 4, int.num = 15, method = "segmented") : 
  Wrong value for parameter 'method'.

From reading the help file (?ipls):

method: iPLS method ( 'forward' or 'backward' )

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.