From 9e4f48320ad4d30a933535cda45956be36e8c0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98topepo=E2=80=99?= <‘mxkuhn@gmail.com’> Date: Thu, 25 Apr 2024 08:23:08 -0400 Subject: [PATCH] parent -> container --- R/adjust-equivocal-zone.R | 8 ++++---- R/adjust-numeric-calibration.R | 4 ++-- R/adjust-numeric-range.R | 6 +++--- R/adjust-predictions-custom.R | 4 ++-- R/adjust-probability-calibration.R | 4 ++-- R/adjust-probability-threshold.R | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/R/adjust-equivocal-zone.R b/R/adjust-equivocal-zone.R index 0412b11..a409f09 100644 --- a/R/adjust-equivocal-zone.R +++ b/R/adjust-equivocal-zone.R @@ -68,7 +68,7 @@ print.equivocal_zone <- function(x, ...) { } #' @export -fit.equivocal_zone <- function(object, data, parent = NULL, ...) { +fit.equivocal_zone <- function(object, data, container = NULL, ...) { new_operation( class(object), inputs = object$inputs, @@ -79,9 +79,9 @@ fit.equivocal_zone <- function(object, data, parent = NULL, ...) { } #' @export -predict.equivocal_zone <- function(object, new_data, parent, ...) { - est_nm <- parent$columns$estimate - prob_nm <- parent$columns$probabilities[1] +predict.equivocal_zone <- function(object, new_data, container, ...) { + est_nm <- container$columns$estimate + prob_nm <- container$columns$probabilities[1] lvls <- levels(new_data[[est_nm]]) col_syms <- syms(prob_nm[1]) cls_pred <- probably::make_two_class_pred( diff --git a/R/adjust-numeric-calibration.R b/R/adjust-numeric-calibration.R index ab78a16..26df1ce 100644 --- a/R/adjust-numeric-calibration.R +++ b/R/adjust-numeric-calibration.R @@ -65,7 +65,7 @@ print.numeric_calibration <- function(x, ...) { } #' @export -fit.numeric_calibration <- function(object, data, parent = NULL, ...) { +fit.numeric_calibration <- function(object, data, container = NULL, ...) { new_operation( class(object), inputs = object$inputs, @@ -76,7 +76,7 @@ fit.numeric_calibration <- function(object, data, parent = NULL, ...) { } #' @export -predict.numeric_calibration <- function(object, new_data, parent, ...) { +predict.numeric_calibration <- function(object, new_data, container, ...) { probably::cal_apply(new_data, object$argument$calibrator) } diff --git a/R/adjust-numeric-range.R b/R/adjust-numeric-range.R index f4a952b..35f36b1 100644 --- a/R/adjust-numeric-range.R +++ b/R/adjust-numeric-range.R @@ -56,7 +56,7 @@ print.numeric_range <- function(x, ...) { } #' @export -fit.numeric_range <- function(object, data, parent = NULL, ...) { +fit.numeric_range <- function(object, data, container = NULL, ...) { new_operation( class(object), inputs = object$inputs, @@ -67,8 +67,8 @@ fit.numeric_range <- function(object, data, parent = NULL, ...) { } #' @export -predict.numeric_range <- function(object, new_data, parent, ...) { - est_nm <- parent$columns$estimate +predict.numeric_range <- function(object, new_data, container, ...) { + est_nm <- container$columns$estimate lo <- object$arguments$lower_limit hi <- object$arguments$upper_limit diff --git a/R/adjust-predictions-custom.R b/R/adjust-predictions-custom.R index 3663a40..46488b8 100644 --- a/R/adjust-predictions-custom.R +++ b/R/adjust-predictions-custom.R @@ -55,7 +55,7 @@ print.predictions_custom <- function(x, ...) { } #' @export -fit.predictions_custom <- function(object, data, parent = NULL, ...) { +fit.predictions_custom <- function(object, data, container = NULL, ...) { new_operation( class(object), inputs = object$inputs, @@ -66,7 +66,7 @@ fit.predictions_custom <- function(object, data, parent = NULL, ...) { } #' @export -predict.predictions_custom <- function(object, new_data, parent, ...) { +predict.predictions_custom <- function(object, new_data, container, ...) { dplyr::mutate(new_data, !!!object$arguments$commands) } diff --git a/R/adjust-probability-calibration.R b/R/adjust-probability-calibration.R index bfa2025..e9b6989 100644 --- a/R/adjust-probability-calibration.R +++ b/R/adjust-probability-calibration.R @@ -43,7 +43,7 @@ print.probability_calibration <- function(x, ...) { } #' @export -fit.probability_calibration <- function(object, data, parent = NULL, ...) { +fit.probability_calibration <- function(object, data, container = NULL, ...) { new_operation( class(object), inputs = object$inputs, @@ -54,7 +54,7 @@ fit.probability_calibration <- function(object, data, parent = NULL, ...) { } #' @export -predict.probability_calibration <- function(object, new_data, parent, ...) { +predict.probability_calibration <- function(object, new_data, container, ...) { probably::cal_apply(new_data, object$argument$calibrator) } diff --git a/R/adjust-probability-threshold.R b/R/adjust-probability-threshold.R index 36c6381..0c833c6 100644 --- a/R/adjust-probability-threshold.R +++ b/R/adjust-probability-threshold.R @@ -64,7 +64,7 @@ print.probability_threshold <- function(x, ...) { } #' @export -fit.probability_threshold <- function(object, data, parent = NULL, ...) { +fit.probability_threshold <- function(object, data, container = NULL, ...) { new_operation( class(object), inputs = object$inputs, @@ -75,9 +75,9 @@ fit.probability_threshold <- function(object, data, parent = NULL, ...) { } #' @export -predict.probability_threshold <- function(object, new_data, parent, ...) { - est_nm <- parent$columns$estimate - prob_nm <- parent$columns$probabilities[1] +predict.probability_threshold <- function(object, new_data, container, ...) { + est_nm <- container$columns$estimate + prob_nm <- container$columns$probabilities[1] lvls <- levels(new_data[[est_nm]]) new_data[[est_nm]] <-