Skip to content

How to save components in pls model

3 messages · Hossein Shafizadeh, Roger Bivand

#
Hello everyone,
I want to *save the components *when using pls, I tried several ways but
failed.
No matter if using the caret package or in other coding formats. The code
in the caret is:
factors <- c("a","b","c")
set.seed(123)
silt <- caret::train(extsentinel[,factors],extsentinel$Silt,metric="RMSE",
                method="pls",tuneLength = 10 , importance=T, verbose=FALSE,
                trControl=trainControl(method="cv",savePredictions =
"final"),
                returnData=T, preProc = c("BoxCox","center", "scale"))

Thanks in advance,
Hossein
#
On Sat, 22 Jun 2019, Hossein Shafizadeh wrote:

            
Maybe you should condider a different list? The only reason this list 
might be relevant is if the object name extsentinel suggests that you are 
using earth observation data. In any case a reproducible example would be 
needed using a built in data set, such as a raster image from a CRAN 
package, or spDataLarge::landsat; install from:

install.packages("spDataLarge", repos = "https://nowosad.github.io/drat/", 
type = "source")

Roger

  
    
#
Thank you for your kind reply.
Hossein
On Sun, Jun 23, 2019 at 1:46 PM Roger Bivand <Roger.Bivand at nhh.no> wrote: