pecs | R Documentation |
Methods to plot prediction error curves (pecs) for either a PredictionSurv object or a list of trained LearnerSurvs.
pecs(x, measure = c("graf", "logloss"), times, n, eps = NULL, ...) ## S3 method for class 'list' pecs( x, measure = c("graf", "logloss"), times, n, eps = NULL, task = NULL, row_ids = NULL, newdata = NULL, train_task = NULL, train_set = NULL, proper = TRUE, ... ) ## S3 method for class 'PredictionSurv' pecs( x, measure = c("graf", "logloss"), times, n, eps = 1e-15, train_task = NULL, train_set = NULL, proper = TRUE, ... )
x |
(PredictionSurv or |
measure |
( |
times |
( |
n |
( |
eps |
( |
... |
Additional arguments. |
task |
(TaskSurv) |
row_ids |
( |
newdata |
( |
train_task |
(TaskSurv) |
train_set |
( |
proper |
( |
If times
and n
are missing then measure
is evaluated over all observed time-points
from the PredictionSurv or TaskSurv object. If a range is provided for times
without n
,
then all time-points between the range are returned.
## Not run: if (requireNamespace("ggplot2", quietly = TRUE)) { #' library(mlr3) task = tsk("rats") # Prediction Error Curves for prediction object learn = lrn("surv.coxph") p = learn$train(task)$predict(task) pecs(p) pecs(p, measure = "logloss", times = c(20, 40, 60, 80)) + ggplot2::geom_point() + ggplot2::ggtitle("Logloss Prediction Error Curve for Cox PH") # Access underlying data x = pecs(p) x$data # Prediction Error Curves for fitted learners learns = lrns(c("surv.kaplan", "surv.coxph")) lapply(learns, function(x) x$train(task)) pecs(learns, task = task, measure = "logloss", times = c(20, 90), n = 10) } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.