Skip to content

Commit

Permalink
update mlr3proba to 0.5.3 + refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bblodfon committed Sep 11, 2023
1 parent c8041b4 commit f162a31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Suggests:
mgcv,
mlr3cluster,
mlr3learners (>= 0.4.2),
mlr3proba,
mlr3proba (>= 0.5.3),
mlr3pipelines,
mvtnorm,
nnet,
Expand Down
14 changes: 3 additions & 11 deletions R/learner_BART_surv_bart.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,9 @@ delayedAssign(
c(3, 2, 1)
)

# Mean posterior survival matrix (N obs x K times)
surv = matrix(pred$surv.test.mean, nrow = N, ncol = K, byrow = TRUE)

# get crank as expected mortality using mean posterior
pred_list = mlr3proba::.surv_return(times = times, surv = surv)

# replace with the full survival posterior
pred_list$distr = surv.array

# return list with crank and distr
pred_list
# distr => full survival array
# crank => expected mortality using the mean posterior survival matrix
mlr3proba::.surv_return(times = times, surv = surv.array, which.curve = 'mean')
}
)
)
Expand Down

0 comments on commit f162a31

Please sign in to comment.