Skip to content

misleading error re: fit_xy() with GAMs #1014

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
simonpcouch opened this issue Nov 2, 2023 · 1 comment · Fixed by #1015
Closed

misleading error re: fit_xy() with GAMs #1014

simonpcouch opened this issue Nov 2, 2023 · 1 comment · Fixed by #1015

Comments

@simonpcouch
Copy link
Contributor

This was referenced in a Community issue previously, but the error resulting from not using a model formula with GAMs is a head-scratcher:

library(tidymodels)

gam_wflow <- 
  workflow() %>%
  add_formula(mpg ~ .) %>%
  add_model(gen_additive_mod("regression")) 

gam_fit <- gam_wflow %>%
  fit(mtcars)
#> Error in `fit_xy()`:
#> ! `fit()` must be used with GAM models (due to its use of formulas).

With tune, as well, it seems to suggest even that GAMs can't be tuned / evaluated across resamples:

gam_res <- fit_resamples(gam_wflow, bootstraps(mtcars))
#> → A | error:   `fit()` must be used with GAM models (due to its use of formulas).
#> There were issues with some computations   A: x25
#> 
#> Warning: All models failed. Run `show_notes(.Last.tune.result)` for more
#> information.

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

Related to #770.

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 Nov 21, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant