Skip to content

Better error message if outcome has 0 columns #1003

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
EmilHvitfeldt opened this issue Oct 16, 2023 · 1 comment · Fixed by #1016
Closed

Better error message if outcome has 0 columns #1003

EmilHvitfeldt opened this issue Oct 16, 2023 · 1 comment · Fixed by #1016
Labels
feature a feature request or enhancement

Comments

@EmilHvitfeldt
Copy link
Member

Extracted from: https://stackoverflow.com/questions/77305226/why-am-i-receiving-the-error-object-not-found

If someone uses step_dummy() or some other ways in {recipes} to remove the outcome, then parsnip:::check_outcome() throws a wonderfully bad error 😄

library(tidymodels)

rec <- recipe(Species ~ ., data = iris) %>%
  step_dummy(Species)

svm_spec <- 
  svm_rbf() %>% 
  set_engine("kernlab") %>% 
  set_mode("classification")

wflow <- workflow() %>% 
  add_model(svm_spec) %>% 
  add_recipe(rec)

fit(wflow, iris)
#> Error: object '.' not found

Created on 2023-10-16 with reprex v2.0.2

@EmilHvitfeldt EmilHvitfeldt added the feature a feature request or enhancement label Oct 16, 2023
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 18, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant