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

tunable methods from recipes not found #146

Closed
topepo opened this issue Dec 31, 2019 · 0 comments
Closed

tunable methods from recipes not found #146

topepo opened this issue Dec 31, 2019 · 0 comments
Assignees
Labels
bug

Comments

@topepo
Copy link
Collaborator

@topepo topepo commented Dec 31, 2019

With r-devel, a bunch of tune units tests fail because the tunable methods for step functions are not found when tunable() is called.

@DavisVaughan exports them in tidymodels/recipes#406 . Do we need tune to make them accessible too?

(reprex isn't building for me in r-devel 😒)

> library(testthat)
> 
> # From `tune` package directory
> source(test_path("../helper-objects.R"))
> 
> # The specific step methods are not being accessed
> tunable(spline_rec)
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>
> 
> purrr::map_chr(spline_rec$steps, ~ class(.x)[1])
[1] "step_date"      "step_holiday"   "step_rm"        "step_knnimpute"
[5] "step_other"     "step_dummy"     "step_normalize" "step_bs"       
> 
> purrr::map(spline_rec$steps, tunable)
[[1]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[2]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[3]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[4]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[5]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[6]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[7]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

[[8]]
# A tibble: 0 x 5
# … with 5 variables: name <chr>, call_info <list>, source <chr>, component <chr>,
#   component_id <chr>

> 
> # For example: 
> tunable.step_knnimpute(spline_rec$steps[[4]])
# A tibble: 1 x 5
  name      call_info        source component      component_id   
  <chr>     <list>           <chr>  <chr>          <chr>          
1 neighbors <named list [3]> recipe step_knnimpute knnimpute_92x1X
> 
> methods("tunable")
 [1] tunable.boost_tree*       tunable.linear_reg*       tunable.logistic_reg*    
 [4] tunable.model_spec*       tunable.multinomial_reg*  tunable.nearest_neighbor*
 [7] tunable.recipe*           tunable.step              tunable.step_bagimpute   
[10] tunable.step_bs           tunable.step_corr         tunable.step_discretize  
[13] tunable.step_downsample   tunable.step_embed*       tunable.step_ica         
[16] tunable.step_isomap       tunable.step_knnimpute    tunable.step_kpca_poly   
[19] tunable.step_kpca_rbf     tunable.step_meanimpute   tunable.step_nnmf        
[22] tunable.step_ns           tunable.step_nzv          tunable.step_other       
[25] tunable.step_pca          tunable.step_pls          tunable.step_poly        
[28] tunable.step_rollimpute   tunable.step_texthash*    tunable.step_tf*         
[31] tunable.step_tokenfilter* tunable.step_tokenize*    tunable.step_umap*       
[34] tunable.step_upsample     tunable.step_window       tunable.step_woe*        
[37] tunable.workflow*        
see '?methods' for accessing help and source code
> 
> sessioninfo::session_info()
─ Session info ──────────────────────────────────────────────────────────────────────
 setting  value                                             
 version  R Under development (unstable) (2019-12-29 r77627)
 os       macOS Catalina 10.15.1                            
 system   x86_64, darwin15.6.0                              
 ui       RStudio                                           
 language (EN)                                              
 collate  en_US.UTF-8                                       
 ctype    en_US.UTF-8                                       
 tz       America/New_York                                  
 date     2019-12-31Packages ──────────────────────────────────────────────────────────────────────────
 package     * version    date       lib source                             
 assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.0.0)                     
 backports     1.1.5      2019-10-02 [1] CRAN (R 4.0.0)                     
 class         7.3-15     2019-01-01 [1] CRAN (R 4.0.0)                     
 cli           2.0.0      2019-12-09 [1] CRAN (R 4.0.0)                     
 codetools     0.2-16     2018-12-24 [1] CRAN (R 4.0.0)                     
 colorspace    1.4-1      2019-03-18 [1] CRAN (R 4.0.0)                     
 crayon        1.3.4      2017-09-16 [1] CRAN (R 4.0.0)                     
 dials       * 0.0.4      2019-12-02 [1] CRAN (R 4.0.0)                     
 DiceDesign    1.8-1      2019-07-31 [1] CRAN (R 4.0.0)                     
 digest        0.6.23     2019-11-23 [1] CRAN (R 4.0.0)                     
 dplyr       * 0.8.3      2019-07-04 [1] CRAN (R 4.0.0)                     
 ellipsis      0.3.0      2019-09-20 [1] CRAN (R 4.0.0)                     
 fansi         0.4.0      2018-10-05 [1] CRAN (R 4.0.0)                     
 foreach       1.4.7      2019-07-27 [1] CRAN (R 4.0.0)                     
 furrr         0.1.0      2018-05-16 [1] CRAN (R 4.0.0)                     
 future        1.15.1     2019-11-25 [1] CRAN (R 4.0.0)                     
 generics      0.0.2      2018-11-29 [1] CRAN (R 4.0.0)                     
 ggplot2     * 3.2.1      2019-08-10 [1] CRAN (R 4.0.0)                     
 globals       0.12.5     2019-12-07 [1] CRAN (R 4.0.0)                     
 glue          1.3.1      2019-03-12 [1] CRAN (R 4.0.0)                     
 gower         0.2.1      2019-05-14 [1] CRAN (R 4.0.0)                     
 GPfit         1.0-8      2019-02-08 [1] CRAN (R 4.0.0)                     
 gtable        0.3.0      2019-03-25 [1] CRAN (R 4.0.0)                     
 hardhat       0.1.0      2019-12-16 [1] CRAN (R 4.0.0)                     
 ipred         0.9-9      2019-04-28 [1] CRAN (R 4.0.0)                     
 iterators     1.0.12     2019-07-26 [1] CRAN (R 4.0.0)                     
 kernlab     * 0.9-29     2019-11-12 [1] CRAN (R 4.0.0)                     
 lattice       0.20-38    2018-11-04 [1] CRAN (R 4.0.0)                     
 lava          1.6.6      2019-08-01 [1] CRAN (R 4.0.0)                     
 lazyeval      0.2.2      2019-03-15 [1] CRAN (R 4.0.0)                     
 lhs           1.0.1      2019-02-03 [1] CRAN (R 4.0.0)                     
 lifecycle     0.1.0      2019-08-01 [1] CRAN (R 4.0.0)                     
 listenv       0.8.0      2019-12-05 [1] CRAN (R 4.0.0)                     
 lubridate     1.7.4      2018-04-11 [1] CRAN (R 4.0.0)                     
 magrittr      1.5        2014-11-22 [1] CRAN (R 4.0.0)                     
 MASS          7.3-51.5   2019-12-20 [1] CRAN (R 4.0.0)                     
 Matrix        1.2-18     2019-11-27 [1] CRAN (R 4.0.0)                     
 munsell       0.5.0      2018-06-12 [1] CRAN (R 4.0.0)                     
 nnet          7.3-12     2016-02-02 [1] CRAN (R 4.0.0)                     
 packrat       0.5.0      2018-11-14 [1] CRAN (R 4.0.0)                     
 parsnip     * 0.0.4.9000 2019-12-31 [1] Github (tidymodels/parsnip@2e5d3fa)
 pillar        1.4.3      2019-12-20 [1] CRAN (R 4.0.0)                     
 pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.0.0)                     
 plyr          1.8.5      2019-12-10 [1] CRAN (R 4.0.0)                     
 pROC          1.15.3     2019-07-21 [1] CRAN (R 4.0.0)                     
 prodlim       2019.11.13 2019-11-17 [1] CRAN (R 4.0.0)                     
 purrr         0.3.3      2019-10-18 [1] CRAN (R 4.0.0)                     
 R6            2.4.1      2019-11-12 [1] CRAN (R 4.0.0)                     
 Rcpp          1.0.3      2019-11-08 [1] CRAN (R 4.0.0)                     
 recipes     * 0.1.8      2019-12-18 [1] CRAN (R 4.0.0)                     
 rlang         0.4.2      2019-11-23 [1] CRAN (R 4.0.0)                     
 rpart         4.1-15     2019-04-12 [1] CRAN (R 4.0.0)                     
 rsample     * 0.0.5      2019-07-12 [1] CRAN (R 4.0.0)                     
 rstudioapi    0.10       2019-03-19 [1] CRAN (R 4.0.0)                     
 scales      * 1.1.0      2019-11-18 [1] CRAN (R 4.0.0)                     
 sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.0.0)                     
 stringi       1.4.3      2019-03-12 [1] CRAN (R 4.0.0)                     
 stringr       1.4.0      2019-02-10 [1] CRAN (R 4.0.0)                     
 survival      3.1-8      2019-12-03 [1] CRAN (R 4.0.0)                     
 testthat    * 2.3.1      2019-12-01 [1] CRAN (R 4.0.0)                     
 tibble        2.1.3      2019-06-06 [1] CRAN (R 4.0.0)                     
 tidyr       * 1.0.0      2019-09-11 [1] CRAN (R 4.0.0)                     
 tidyselect    0.2.5      2018-10-11 [1] CRAN (R 4.0.0)                     
 timeDate      3043.102   2018-02-21 [1] CRAN (R 4.0.0)                     
 tune        * 0.0.1      2019-12-31 [1] Github (tidymodels/tune@e044702)   
 utf8          1.1.4      2018-05-24 [1] CRAN (R 4.0.0)                     
 vctrs         0.2.1      2019-12-17 [1] CRAN (R 4.0.0)                     
 withr         2.1.2      2018-03-15 [1] CRAN (R 4.0.0)                     
 workflows   * 0.1.0      2019-12-30 [1] CRAN (R 4.0.0)                     
 yardstick   * 0.0.4      2019-08-26 [1] CRAN (R 4.0.0)                     
 zeallot       0.1.0      2018-01-28 [1] CRAN (R 4.0.0)                     

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.