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

No augment method for stacks #173

Closed
juliasilge opened this issue Jan 11, 2023 · 3 comments · Fixed by #176
Closed

No augment method for stacks #173

juliasilge opened this issue Jan 11, 2023 · 3 comments · Fixed by #176

Comments

@juliasilge
Copy link
Member

As pointed out in rstudio/vetiver-r#170, we don't yet have augment methods for stacks objects:

library(tidymodels)
library(stacks)

tree_frogs_class <- 
    tree_frogs %>%
    dplyr::select(-c(clutch, latency))

tree_frogs_class_split <- initial_split(tree_frogs_class)
tree_frogs_class_train <- training(tree_frogs_class_split)
tree_frogs_class_test  <- testing(tree_frogs_class_split)

log_st <-
    stacks() %>%
    add_candidates(log_res_nn) %>%
    add_candidates(log_res_rf) %>%
    blend_predictions() %>%
    fit_members()

## OK:
predict(log_st, tree_frogs_class_test)
#> # A tibble: 303 × 1
#>    .pred_class
#>    <fct>      
#>  1 yes        
#>  2 yes        
#>  3 yes        
#>  4 no         
#>  5 no         
#>  6 no         
#>  7 no         
#>  8 yes        
#>  9 no         
#> 10 no         
#> # … with 293 more rows

## not OK:
augment(log_st, tree_frogs_class_test)
#> Error: No augment method for objects of class linear_stack

Created on 2023-01-11 with reprex v2.0.2

We show folks how to set up vetiver model monitoring using augment(), so this would be nice to have.

@simonpcouch
Copy link
Collaborator

On board—thanks for noting this. I will put some effort in on this in coming weeks. :)

@simonpcouch
Copy link
Collaborator

This should be squared away now! Let me know if this does the trick for you—if not, glad to make revisions before this heads to CRAN (on no specific timeline yet).

@github-actions
Copy link

This issue 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.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants