tidymodels / tune

Tools for tidy parameter tuning
https://tune.tidymodels.org
Other
276 stars 42 forks source link

prediction across submodels fails with `tune()` label #695

Closed simonpcouch closed 1 year ago

simonpcouch commented 1 year ago

With dev tune, the name for the submodels argument is not properly patched before being sent off to parsnip. Introduced in https://github.com/tidymodels/tune/commit/04e66b38f20d4ed1417b0578ef8ec7747e8a6fb9, this is the reason for the revdepcheck failure seen in https://github.com/tidymodels/tune/pull/694#issuecomment-1613314961!

library(tidymodels)

set.seed(2020)
knn_res <- 
  tune_grid(
    nearest_neighbor(mode = "regression", neighbors = tune("k")),
    mpg ~ .,
    resamples = bootstraps(mtcars, 5),
    grid = 4
  )
#> → A | error:   argument is of length zero
#> There were issues with some computations   A: x1
#> There were issues with some computations   A: x5
#> 
#> Warning: All models failed. Run `show_notes(.Last.tune.result)` for more
#> information.

knn_res
#> # Tuning results
#> # Bootstrap sampling 
#> # A tibble: 5 × 4
#>   splits          id         .metrics .notes          
#>   <list>          <chr>      <list>   <list>          
#> 1 <split [32/13]> Bootstrap1 <NULL>   <tibble [1 × 3]>
#> 2 <split [32/12]> Bootstrap2 <NULL>   <tibble [1 × 3]>
#> 3 <split [32/10]> Bootstrap3 <NULL>   <tibble [1 × 3]>
#> 4 <split [32/12]> Bootstrap4 <NULL>   <tibble [1 × 3]>
#> 5 <split [32/14]> Bootstrap5 <NULL>   <tibble [1 × 3]>
#> 
#> There were issues with some computations:
#> 
#>   - Error(s) x5: argument is of length zero
#> 
#> Run `show_notes(.Last.tune.result)` for more information.

Created on 2023-06-29 with reprex v2.0.2

github-actions[bot] commented 1 year ago

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.