Learn R Programming

survdnn (version 0.6.0)

evaluate_survdnn: Evaluate a survdnn Model Using Survival Metrics

Description

Computes evaluation metrics for a fitted `survdnn` model at one or more time points. Supported metrics include the concordance index (`"cindex"`), Brier score (`"brier"`), and integrated Brier score (`"ibs"`).

Usage

evaluate_survdnn(
  model,
  metrics = c("cindex", "brier", "ibs"),
  times,
  newdata = NULL
)

Value

A tibble with evaluation results, containing at least `metric`, `value`, and possibly `time`.

Arguments

model

A fitted `survdnn` model object.

metrics

A character vector of metric names: `"cindex"`, `"brier"`, `"ibs"`.

times

A numeric vector of evaluation time points.

newdata

Optional. A data frame on which to evaluate the model. Defaults to training data.

Examples

Run this code
library(survival)
data(veteran)
# \donttest{
mod <- survdnn(Surv(time, status) ~ age + karno + celltype,
               data = veteran, epochs = 5, verbose = FALSE)
evaluate_survdnn(mod, metrics = c("cindex", "ibs"), times = c(30, 90, 180))
evaluate_survdnn(mod, metrics = "brier", times = c(30, 90, 180))
# }

Run the code above in your browser using DataLab