Biregular grids can be created for any number of parameter objects.
Arguments
- x
A
param
object, list, orparameters
.- ...
One or more
param
objects (such asmtry()
orpenalty()
). None of the objects can haveunknown()
values in the parameter ranges or values.- center
A numeric vector specifying the point onto which the biregular grid should be centered. Defaults to
NULL
, in which casegrid_regular
is used instead.- levels
An integer for the number of values of each parameter to use to make the regular grid.
levels
can be a single integer or a vector of integers that is the same length as the number of parameters in...
.levels
can be a named integer vector, with names that match the id values of parameters.- original
A logical: should the parameters be in the original units or in the transformed space (if any)?
- filter
A logical: should the parameters be filtered prior to generating the grid. Must be a single expression referencing parameter names that evaluates to a logical vector.
Details
Note that there may a difference in grids depending on how the function
is called. If the call uses the parameter objects directly the possible
ranges come from the objects in dials
. For example:
mixture()
However, in some cases, the parsnip
and recipe
packages overrides
the default ranges for specific models and preprocessing steps. If the
grid function uses a parameters
object created from a model or recipe,
the ranges may have different defaults (specific to those models). Using
the example above, the mixture
argument above is different for
glmnet
models:
Examples
grid_biregular(dials::mixture(), center = 0.2)
#> # A tibble: 3 × 1
#> mixture
#> <dbl>
#> 1 0
#> 2 0.2
#> 3 1