Skip to content

Should varying_args.step() actually remove NULL arguments? #132

Description

@DavisVaughan

Currently, varying_args.step() removes any argument where the value is NULL. I'm not sure this is the right behavior. Consider this example:

library(parsnip)
library(recipes)

x <- recipe(Species ~ ., data = iris) %>%
  step_bs(Sepal.Length, degree = varying())

varying_args(x)
#> # A tibble: 2 x 4
#>   name    varying id      type 
#>   <chr>   <lgl>   <chr>   <chr>
#> 1 degree  TRUE    step_bs step 
#> 2 options FALSE   step_bs step

Created on 2019-01-24 by the reprex package (v0.2.1.9000)

In this case deg_free is a parameter that could validly have been tuned over, but it was not shown here because its default value is NULL (and nulls are removed). On the other hand, options has a default of list(), so it shows up here.

I think we should not remove any NULL values, so we can print the full set of potential tuning parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions