Skip to content

Throw appropriate error when package cannot be tuned #26

@cimentadaj

Description

@cimentadaj
library(tidymodels)
#> ── Attaching packages ───────────────────────────────── tidymodels 0.1.1.9000 ──
#> ✔ broom     0.7.0          ✔ recipes   0.1.13    
#> ✔ dials     0.0.8          ✔ rsample   0.0.7.9000
#> ✔ dplyr     1.0.2          ✔ tibble    3.0.3.9000
#> ✔ ggplot2   3.3.2          ✔ tidyr     1.1.1     
#> ✔ infer     0.5.3          ✔ tune      0.1.1.9000
#> ✔ modeldata 0.0.2          ✔ workflows 0.1.3.9000
#> ✔ parsnip   0.1.3.9000     ✔ yardstick 0.0.7     
#> ✔ purrr     0.3.4
#> ── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
#> ✖ purrr::discard() masks scales::discard()
#> ✖ dplyr::filter()  masks stats::filter()
#> ✖ dplyr::lag()     masks stats::lag()
#> ✖ recipes::step()  masks stats::step()
library(tidyflow)
#> 
#> Attaching package: 'tidyflow'
#> The following object is masked from 'package:tune':
#> 
#>     parameters
#> The following object is masked from 'package:dials':
#> 
#>     parameters

mod <- logistic_reg(penalty = tune(), mixture = tune()) %>% set_engine("glm")

tflow <-
  mtcars %>%
  mutate(am = as.factor(am)) %>% 
  tidyflow(seed = 5131) %>%
  plug_formula(am ~ .) %>%
  plug_resample(vfold_cv) %>%
  plug_grid(grid_regular) %>% 
  plug_model(mod)

fit(tflow)
#> Error: At least one parameter object is required.

This is because I got confused using glm instead of glmnet. Shouldn't this error be delegated to tune or something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions