tidymodels / poissonreg

parsnip wrappers for Poisson regression
https://poissonreg.tidymodels.org
Other
22 stars 4 forks source link

fix single-row predictions for glmnet #49

Closed hfrick closed 1 year ago

hfrick commented 1 year ago

closes #48

library(poissonreg)
#> Loading required package: parsnip

m <- poisson_reg() %>% 
  set_engine("glmnet") %>% 
  fit(count ~ (.)^2, data = seniors[,2:4])

predict(m, new_data = seniors[1,], penalty = 0.1)
#> # A tibble: 1 × 1
#>   .pred
#>   <dbl>
#> 1  724.
multi_predict(m, new_data = seniors[1,])
#> # A tibble: 1 × 1
#>   .pred            
#>   <list>           
#> 1 <tibble [72 × 2]>

Created on 2022-12-19 with reprex v2.0.2

github-actions[bot] commented 1 year ago

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.