| tune | R Documentation |
Grid search over resampling folds. Learners listed by
listlearners(has_tune = TRUE) have a built-in default grid; any other
learner, including a custom one (see fit()), is tuned over the grid you
supply, with every configuration scored on the same splits. The best
configuration is refit on the full data and returned as a ready-to-use
survalis_fit.
tune(
formula,
data,
model,
grid = NULL,
times = NULL,
resampling = cv(),
metric = "ibs",
ncores = 1,
...
)
formula |
A survival formula. |
data |
A data frame. |
model |
A learner id ( |
grid |
A data frame of hyperparameter combinations (one row per
configuration, for example from |
times |
Evaluation grid; |
resampling |
A resampling spec. The built-in tuner uses |
metric |
A single metric to optimise (default |
ncores |
Cores for the inner CV (default |
... |
Fixed learner arguments: forwarded to the built-in tuner, or
added to every configuration of a supplied |
A survalis_tune object: fit (the refit survalis_fit at the best
configuration), results (the scored grid), best (one-row best config),
times, resampling, metric, model.
tuned <- tune(Surv(time, status) ~ age + karno, veteran, "ranger",
grid = expand.grid(num.trees = c(100, 300), mtry = 2, min.node.size = c(5, 15)),
times = c(90, 180), resampling = cv(3), metric = "ibs")
tuned
predict(tuned, veteran[1:3, ], times = c(90, 180))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.