bike_predict icon indicating copy to clipboard operation
bike_predict copied to clipboard

Suggestions for tidymodels + vetiver code

Open juliasilge opened this issue 2 years ago • 2 comments

Hello! 👋 This demo is looking so great; thank you for creating this to show folks how to use our tools. I have a couple of minor suggestions for tidymodels and vetiver code in 01-train-and-deploy-model:

Can you use initial_time_split() here, instead of the manual splitting? Then you can use training() and testing() from tidymodels:

https://github.com/sol-eng/bike_predict/blob/2a18bbb608ba06d52d4a1020ac3ad3e1f9f7ea94/content/02-model/01-train-and-deploy-model/document.qmd#L55-L58

I don't believe you need to manually save the ptype here (or save versioned = TRUE). This should be grabbed automatically from the model_fit:

https://github.com/sol-eng/bike_predict/blob/2a18bbb608ba06d52d4a1020ac3ad3e1f9f7ea94/content/02-model/01-train-and-deploy-model/document.qmd#L172-L175

If you'd like a PR for either of these, I would be happy to do it!

juliasilge avatar Jun 21 '22 22:06 juliasilge

I edited because I realized that we are predicting on the endpoint here and it doesn't have an augment() method yet, as tracked in rstudio/vetiver-r#10. Apologies!

juliasilge avatar Jun 21 '22 23:06 juliasilge

Thank you Julia - this is great, I did not know about these functions. I will update the code to include them :)

SamEdwardes avatar Jun 29 '22 21:06 SamEdwardes