Learn R Programming

survdnn (version 0.7.5)

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,
  na_action = c("omit", "fail"),
  verbose = FALSE
)

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.

na_action

Character. How to handle missing values in evaluation data: `"omit"` drops incomplete rows, `"fail"` errors if any NA is present.

verbose

Logical. If TRUE and `na_action="omit"`, prints a message when rows are removed.