Skip to content

Commit

Permalink
tidy style: remove unneeded spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Apr 22, 2024
1 parent 4164156 commit 2689bdb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/container.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fit.container <- function(object, .data, outcome, estimate, probabilities = c(),



object <- set_container_type(object, .data[[ dat$outcome ]])
object <- set_container_type(object, .data[[dat$outcome]])

object <- new_container(object$mode, object$type,
operations = object$operations,
Expand Down
4 changes: 2 additions & 2 deletions R/equivocal_zone.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ fit.equivocal_zone <- function(object, data, parent = NULL, ...) {
predict.equivocal_zone <- function(object, new_data, parent, ...) {
est_nm <- parent$columns$estimate
prob_nm <- parent$columns$probabilities[1]
lvls <- levels(new_data[[ est_nm ]])
lvls <- levels(new_data[[est_nm]])
col_syms <- syms(prob_nm[1])
cls_pred <- probably::make_two_class_pred(new_data[[prob_nm]], levels = lvls,
buffer = object$arguments$value,
threshold = object$arguments$threshold)
new_data[[ est_nm ]] <- cls_pred # todo convert to factor?
new_data[[est_nm]] <- cls_pred # todo convert to factor?
new_data
}

Expand Down
4 changes: 2 additions & 2 deletions R/numeric_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ predict.numeric_range <- function(object, new_data, parent, ...) {
hi <- object$arguments$upper_limit

# todo depends on tm predict col names
new_data[[ est_nm ]] <-
probably::bound_prediction(new_data, lower_limit = lo, upper_limit = hi)[[ est_nm ]]
new_data[[est_nm]] <-
probably::bound_prediction(new_data, lower_limit = lo, upper_limit = hi)[[est_nm]]
new_data
}

Expand Down
8 changes: 4 additions & 4 deletions R/prob_threshold.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ fit.probability_threshold <- function(object, data, parent = NULL, ...) {
predict.probability_threshold <- function(object, new_data, parent, ...) {
est_nm <- parent$columns$estimate
prob_nm <- parent$columns$probabilities[1]
lvls <- levels(new_data[[ est_nm ]])
lvls <- levels(new_data[[est_nm]])

new_data[[ est_nm ]] <-
ifelse(new_data[[ prob_nm ]] >= object$arguments$threshold, lvls[1], lvls[2])
new_data[[ est_nm ]] <- factor(new_data[[ est_nm ]], levels = lvls)
new_data[[est_nm]] <-
ifelse(new_data[[prob_nm]] >= object$arguments$threshold, lvls[1], lvls[2])
new_data[[est_nm]] <- factor(new_data[[est_nm]], levels = lvls)
new_data
}

Expand Down

0 comments on commit 2689bdb

Please sign in to comment.