Skip to content

Expand checking done in check_args() #1095

Open
@EmilHvitfeldt

Description

@EmilHvitfeldt

Something like decision_tree() doesn't do any type checking, where we can at least check for numeric input and sensible ranges without getting opinionated

library(parsnip)

data(hpc_data, package = "modeldata")

bt <- decision_tree(tree_depth = c(1, 5, 10)) %>% 
  set_engine("rpart") %>%
  set_mode("classification")

fit(bt, class ~ ., hpc_data)
#> Error in if (maxdepth > 30L) stop("Maximum depth is 30"): the condition has length > 1

Created on 2024-04-01 with reprex v2.1.0

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