Skip to content

Better error message if outcome has 0 columns #1003

Closed
@EmilHvitfeldt

Description

@EmilHvitfeldt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions