Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vetiver support for glm() #75

Merged
merged 6 commits into from
Feb 9, 2022
Merged

Add vetiver support for glm() #75

merged 6 commits into from
Feb 9, 2022

Conversation

juliasilge
Copy link
Member

@juliasilge juliasilge commented Feb 8, 2022

library(vetiver)
cars_glm <- glm(mpg ~ ., data = mtcars)
v <- vetiver_model(cars_glm, "cars_gaussian")
v
#> 
#> ── cars_gaussian ─ <butchered_glm> model for deployment 
#> A generalized linear model (gaussian family, identity link) using 10 features


library(pins)
model_board <- board_temp()
vetiver_pin_write(model_board, v)
#> Creating new version '20220209T001336Z-2ad1f'
#> Writing to pin 'cars_gaussian'
#> 
#> Create a Model Card for your published model
#> • Model Cards provide a framework for transparent, responsible reporting
#> • Use the vetiver `.Rmd` template as a place to start

library(plumber)
pr() %>% vetiver_pr_predict(v)
#> # Plumber router with 2 endpoints, 4 filters, and 0 sub-routers.
#> # Use `pr_run()` on this object to start the API.
#> ├──[queryString]
#> ├──[body]
#> ├──[cookieParser]
#> ├──[sharedSecret]
#> ├──/ping (GET)
#> └──/predict (POST)

Created on 2022-02-08 by the reprex package (v2.0.1)

Right now one of the tests has ignore_function_env = TRUE, ignore_formula_env = TRUE because the butcher method isn't great. I have opened tidymodels/butcher#211 to fix that.

@juliasilge juliasilge merged commit f9b9c73 into main Feb 9, 2022
@juliasilge juliasilge deleted the add-glm branch February 9, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant