Error - lasso reg.

Hi. I am having an error in my code of fitting a lasso regression model to predict weight based on all the other variables.

May someone help please? Thank you

library(tidyverse)
library(tidymodels)
#> Registered S3 method overwritten by 'tune':
#>   method                   from   
#>   required_pkgs.model_spec parsnip
fitted_model %>%
  augment(new_data = zoo_train) %>%
  conf_mat(truth = weight, estimate = .pred_class)
#> Error in lambda[1] - s : non-numeric argument to binary operator

Created on 2022-03-26 by the reprex package (v2.0.1)

Hi there, you will get much better quality help by creating a reproducible example

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.