dials-package: dials: Tools for working with tuning parameters

dials-packageR Documentation

dials: Tools for working with tuning parameters


dials provides a framework for defining, creating, and managing tuning parameters for modeling. It contains functions to create tuning parameter objects (e.g. mtry() or penalty()) and others for creating tuning grids (e.g. grid_regular()). There are also functions for generating random values or specifying a transformation of the parameters.


Maintainer: Hannah Frick hannah@posit.co


Other contributors:

  • Posit Software, PBC [copyright holder, funder]

See Also

Useful links:


# Suppose we were tuning a linear regression model that was fit with glmnet
# and there was a predictor that used a spline basis function to enable a
# nonlinear fit. We can use `penalty()` and `mixture()` for the glmnet parts
# and `deg_free()` for the spline.

# A full 3^3 factorial design where the regularization parameter is on
# the log scale:
simple_set <- grid_regular(penalty(), mixture(), deg_free(), levels = 3)

# A random grid of 5 combinations
random_set <- grid_random(penalty(), mixture(), deg_free(), size = 5)

# A small space-filling design based on experimental design methods:
design_set <- grid_max_entropy(penalty(), mixture(), deg_free(), size = 5)

dials documentation built on April 3, 2023, 5:43 p.m.