Skip to content

Commit 6d4100f

Browse files
authored
Merge pull request #1068 from tidymodels/predict-streamline
Sync code/comment patterns across prediction types
2 parents a73cd32 + 9f4cf5b commit 6d4100f

5 files changed

+5
-5
lines changed

R/predict_hazard.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ predict_hazard.model_fit <- function(object,
3232
if (!is.null(object$spec$method$pred$hazard$pre))
3333
new_data <- object$spec$method$pred$hazard$pre(new_data, object)
3434

35-
# Pass some extra arguments to be used in post-processor
35+
# create prediction call
3636
pred_call <- make_pred_call(object$spec$method$pred$hazard)
3737

3838
res <- eval_tidy(pred_call)

R/predict_linear_pred.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ predict_linear_pred.model_fit <- function(object, new_data, ...) {
2323
pred_call <- make_pred_call(object$spec$method$pred$linear_pred)
2424

2525
res <- eval_tidy(pred_call)
26-
# post-process the predictions
2726

27+
# post-process the predictions
2828
if (!is.null(object$spec$method$pred$linear_pred$post)) {
2929
res <- object$spec$method$pred$linear_pred$post(res, object)
3030
}

R/predict_numeric.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ predict_numeric.model_fit <- function(object, new_data, ...) {
2727
pred_call <- make_pred_call(object$spec$method$pred$numeric)
2828

2929
res <- eval_tidy(pred_call)
30+
3031
# post-process the predictions
31-
3232
if (!is.null(object$spec$method$pred$numeric$post)) {
3333
res <- object$spec$method$pred$numeric$post(res, object)
3434
}

R/predict_survival.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ predict_survival.model_fit <- function(object,
3434
if (!is.null(object$spec$method$pred$survival$pre))
3535
new_data <- object$spec$method$pred$survival$pre(new_data, object)
3636

37-
# Pass some extra arguments to be used in post-processor
37+
# create prediction call
3838
pred_call <- make_pred_call(object$spec$method$pred$survival)
3939

4040
res <- eval_tidy(pred_call)

R/predict_time.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ predict_time.model_fit <- function(object, new_data, ...) {
2727
pred_call <- make_pred_call(object$spec$method$pred$time)
2828

2929
res <- eval_tidy(pred_call)
30+
3031
# post-process the predictions
31-
3232
if (!is.null(object$spec$method$pred$time$post)) {
3333
res <- object$spec$method$pred$time$post(res, object)
3434
}

0 commit comments

Comments
 (0)