diff --git a/R/container.R b/R/container.R index 48e397b..ffda780 100644 --- a/R/container.R +++ b/R/container.R @@ -58,9 +58,7 @@ new_container <- function(mode, type, operations, columns, ptype, call) { # validate operation order and check duplicates validate_oper_order(operations, mode, call) - # check columns - res <- list(mode = mode, type = type, operations = operations, columns = columns, ptype = ptype) class(res) <- "container" @@ -82,13 +80,9 @@ print.container <- function(x, ...) { invisible(x) } - -# ------------------------------------------------------------------------------ - #' @export fit.container <- function(object, .data, outcome, estimate, probabilities = c(), time = c(), ...) { - # ------------------------------------------------------------------------------ # set columns via tidyselect @@ -114,16 +108,12 @@ fit.container <- function(object, .data, outcome, estimate, probabilities = c(), .data <- tibble::as_tibble(.data) ptype <- .data[0,] - - object <- set_container_type(object, .data[[dat$outcome]]) object <- new_container(object$mode, object$type, operations = object$operations, columns = dat, ptype = ptype, call = current_env()) - # ------------------------------------------------------------------------------ - num_oper <- length(object$operations) for (op in 1:num_oper) { object$operations[[op]] <- fit(object$operations[[op]], data, object) @@ -136,7 +126,6 @@ fit.container <- function(object, .data, outcome, estimate, probabilities = c(), #' @export predict.container <- function(object, new_data, ...) { - # validate levels/classes num_oper <- length(object$operations) for (op in 1:num_oper) { @@ -170,4 +159,3 @@ set_container_type <- function(object, y) { # todo tune_args # todo tidy # todo extract_parameter_set_dials - diff --git a/R/numeric_range.R b/R/numeric_range.R index ac68342..d4de5c9 100644 --- a/R/numeric_range.R +++ b/R/numeric_range.R @@ -3,7 +3,6 @@ #' @param x A [container()]. #' @param upper_limit,lower_limit A numeric value, NA (for no truncation) or #' [hardhat::tune()]. - #' @export adjust_numeric_range <- function(x, lower_limit = -Inf, upper_limit = Inf) { diff --git a/R/probability_calibration.R b/R/probability_calibration.R index a4da622..cdd6e77 100644 --- a/R/probability_calibration.R +++ b/R/probability_calibration.R @@ -5,7 +5,6 @@ #' package, such as [probably::cal_estimate_logistic()]. #' @export adjust_probability_calibration <- function(x, calibrator) { - cls <- c("cal_binary", "cal_multinomial") if (!inherits(calibrator, cls)) { cli_abort("The {.arg calibrator} argument should be an object of // diff --git a/R/reexport.R b/R/reexport.R index 8f3dff8..c0802e3 100644 --- a/R/reexport.R +++ b/R/reexport.R @@ -1,4 +1,3 @@ - #' @importFrom generics fit #' @export generics::fit diff --git a/R/validation-rules.R b/R/validation-rules.R index 8a5ddfd..0e09e94 100644 --- a/R/validation-rules.R +++ b/R/validation-rules.R @@ -1,5 +1,4 @@ validate_oper_order <- function(ops, mode, call) { - oper_data <- tibble::tibble( name = purrr::map_chr(ops, ~ class(.x)[1]),