Implements Bootstrap Aggregating (Bagging) for survival models. It trains multiple base models on bootstrapped subsets and averages the risk scores. This method reduces variance and improves stability.
bagging_pro(
data,
base_model_name,
n_estimators = 10,
subset_fraction = 0.632,
tune_base_model = FALSE,
time_unit = "day",
years_to_evaluate = c(1, 3, 5),
seed = 456
)A list containing the ensemble object, sample scores, and evaluation metrics.
Input data frame (ID, Status, Time, Features).
Character string name of the base model (e.g., "rsf_pro").
Integer. Number of bootstrap iterations.
Numeric (0-1). Fraction of data to sample in each iteration.
Logical. Whether to tune each base model (computationally expensive).
Time unit of the input data.
Numeric vector of years for time-dependent AUC evaluation.
Integer seed for reproducibility.