R/param_num_breaks.R

Defines functions num_breaks

Documented in num_breaks

#' Number of cut-points for binning
#'
#' This parameter controls how many bins are used when discretizing predictors. 
#' Used in `recipes::step_discretize()` and `embed::step_discretize_xgb()`.
#'
#' @inheritParams Laplace
#' @examples
#' num_breaks()
#' @export
num_breaks <- function(range = c(2L, 10L), trans = NULL) {
  new_quant_param(
    type = "integer",
    range = range,
    inclusive = c(TRUE, TRUE),
    trans = trans,
    label = c(num_breaks = "Number of Cut Points"),
    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 12, 2025, 1:46 a.m.