1

I'm trying to use tidymodels to do exercise 6.2 in Applied Predictive Modeling and need to specify a PLS model. I tried using the code from this post, but I keep getting errors.

library (tidymodels)
library(modpls)

pls_spec <- plsmod::pls(num_comp = tune()) %>% 
  set_mode("regression") %>% 
  set_engine("mixOmics")

My Lasso spec works fine:

lasso_spec <- linear_reg(penalty = 0.1, mixture = 1) %>% 
  set_engine("glmnet")

Do I use glmnet for the PLS spec too?

Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75

1 Answers1

1

Some additional research yielded my answer on the tidymodels site: https://www.tidymodels.org/find/parsnip/

enter image description here

Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75