R/param_penalty.R

Defines functions penalty

Documented in penalty

#' Amount of regularization/penalization
#'
#' A numeric parameter function representing the amount of penalties (e.g. L1,
#' L2, etc) in regularized models.
#'
#' @inheritParams Laplace
#'
#' @details
#' This parameter is used for regularized or penalized models such as
#' `parsnip::linear_reg()`, `parsnip::logistic_reg()`, and others.
#' @examples
#' penalty()
#' @export
penalty <- function(range = c(-10, 0), trans = log10_trans()) {
  new_quant_param(
    type = "double",
    range = range,
    inclusive = c(TRUE, TRUE),
    trans = trans,
    label = c(penalty = "Amount of Regularization"),
    finalize = NULL
  )
}

Try the dials package in your browser

Any scripts or data that you put into this service are public.

dials documentation built on Nov. 10, 2022, 6:01 p.m.