R/param_min_unique.R

Defines functions min_unique

Documented in min_unique

#' Number of unique values for pre-processing
#'
#' Some pre-processing parameters require a minimum number of unique data points
#' to proceed. Used in `recipes::step_discretize()`.
#'
#' @inheritParams Laplace
#' @examples
#' min_unique()
#' @export
min_unique <- function(range = c(5L, 15L), trans = NULL) {
  new_quant_param(
    type = "integer",
    range = range,
    inclusive = c(TRUE, TRUE),
    trans = trans,
    label = c(min_unique = "Unique Value Threshold"),
    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 Sept. 11, 2024, 8:25 p.m.