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

move parsnip to depends #109

Open
topepo opened this issue Nov 4, 2022 · 1 comment
Open

move parsnip to depends #109

topepo opened this issue Nov 4, 2022 · 1 comment

Comments

@topepo
Copy link

topepo commented Nov 4, 2022

I know that the package is not specifically a tidymodels package but some function won't work unless it is fully attached:

library(tabnet)

tabnet(mode = "regression") %>%
  set_engine("torch") %>%
  fit(mpg ~ ., data = mtcars)
#> Error in fit(., mpg ~ ., data = mtcars): could not find function "fit"

Created on 2022-11-04 by the reprex package (v2.0.1)

@dfalbel
Copy link
Member

dfalbel commented Nov 4, 2022

I don't think we want to add the parsnip requirement here to this package.
Perhaps we can attach parsnip the first time tabnet is called, for instance, this is also where we register parsnip related stuff:

tabnet/R/parsnip.R

Lines 249 to 252 in cc78cc2

if (!tabnet_env$parsnip_added) {
add_parsnip_tabnet()
tabnet_env$parsnip_added <- TRUE
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants