View source: R/select.best.window.R
sel.best.window | R Documentation |
Takes as input the object containing metrics of the several models computed with cv.wpls and selects the best basing on the lowest RMSE available; then computes PLS and gives as output an object containing results.
sel.best.window(wpls = NULL)
wpls, |
object obtained from cv.wpls. |
An object containing results of the best model. Has the same content of a model obtained from the function pls of mdatools.
data(beer)
conc=beer[,1]
sp=beer[,2:ncol(beer)]
names(sp)=convert.names.wl(1100,2250,2)
conc=unlist(conc)
mywpls=cv.wpls(sp, conc,mode='wpls', windows = 5)
best.pls=sel.best.window(mywpls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.