R/param_class_weights.R

Defines functions class_weights

Documented in class_weights

#' Parameters for class weights for imbalanced problems
#'
#' This parameter can be used to moderate how much influence certain classes
#' receive during training.
#'
#' @inheritParams Laplace
#' @details
#' Used in `brulee::brulee_logistic_reg()` and `brulee::brulee_mlp()`
#' @examples
#' class_weights()
#' @export
class_weights <- function(range = c(1, 10), trans = NULL) {
  new_quant_param(
    type = "double",
    range = range,
    inclusive = c(TRUE, TRUE),
    trans = trans,
    label = c(class_weights = "Minority Class Weight"),
    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 April 3, 2023, 5:43 p.m.