Performs k-fold cross-validation over a user-defined hyperparameter grid and selects the best configuration according to the specified evaluation metric.
tune_survdnn(
formula,
data,
times,
metrics = "cindex",
param_grid,
folds = 3,
.seed = 42,
refit = FALSE,
return = c("all", "summary", "best_model")
)A tibble or model object depending on the `return` value.
A survival formula, e.g., `Surv(time, status) ~ x1 + x2`.
A data frame.
A numeric vector of evaluation time points.
A character vector of evaluation metrics: "cindex", "brier", or "ibs". Only the first metric is used for model selection.
A named list defining hyperparameter combinations to evaluate. Required names: `hidden`, `lr`, `activation`, `epochs`, `loss`.
Number of cross-validation folds (default: 3).
Optional seed for reproducibility (default: 42).
Logical. If TRUE, refits the best model on the full dataset.
One of "all", "summary", or "best_model":
Returns the full cross-validation result across all combinations.
Returns averaged results per configuration.
Returns the refitted model or best hyperparameters.