parsnip icon indicating copy to clipboard operation
parsnip copied to clipboard

`multi_predict._elnet()` doesn't error on inappropriate `type` like `type = "class"`

Open hfrick opened this issue 3 years ago • 0 comments

library(parsnip)
data(Chicago, package = "modeldata")

lm_spec <- linear_reg(penalty = 0.1) %>% set_engine("glmnet")
lm_fit <- fit(lm_spec, ridership ~ Clark_Lake + Quincy_Wells, data = Chicago)

multi_predict(lm_fit, Chicago[1:6,], penalty = c(0.05, 0.1), type = "class")
#> # A tibble: 6 x 1
#>   .pred               
#>   <list>              
#> 1 <tibble[,2] [2 × 2]>
#> 2 <tibble[,2] [2 × 2]>
#> 3 <tibble[,2] [2 × 2]>
#> 4 <tibble[,2] [2 × 2]>
#> 5 <tibble[,2] [2 × 2]>
#> 6 <tibble[,2] [2 × 2]>

Created on 2021-06-21 by the reprex package (v2.0.0)

hfrick avatar Jun 21 '21 13:06 hfrick