| highmlr | R Documentation |
Fits one of several survival ML methods and returns a unified 'highmlr_fit' object summarising the selected features, their importance/coefficients, and (optionally) out-of-sample performance.
highmlr(
data,
time,
status,
features = NULL,
method = c("coxnet", "rsf", "aorsf", "xgboost", "stability", "univariate", "pseudo",
"finegray"),
engine = NULL,
recipe = NULL,
resampling = c("cv", "bootstrap", "holdout", "none"),
folds = 5L,
tune = FALSE,
top_n = 50L,
parallel = FALSE,
seed = NULL,
...
)
data |
A data frame containing 'time', 'status', and the candidate features (or a superset). Rows with missing time/status are dropped. |
time |
Character scalar: name of the survival time column. |
status |
Character scalar: name of the event indicator column. For right-censored methods: 1 = event, 0 = censored. For Fine-Gray (method = "finegray"): 0 = censored, 1 = event of interest, 2+ = competing event(s). |
features |
Character vector of candidate feature column names. If 'NULL' (default), all columns except 'time' and 'status' are used. |
method |
One of '"coxnet"', '"rsf"', '"aorsf"', '"xgboost"', '"stability"', '"univariate"', '"pseudo"', '"finegray"'. |
engine |
Optional engine override. |
recipe |
Optional preprocessing recipe object (currently accepted for forward compatibility; not yet applied). |
resampling |
One of '"cv"', '"bootstrap"', '"holdout"', '"none"'. |
folds |
Integer, number of CV folds (default 5). |
tune |
Logical. Internal tuning (currently coxnet only). |
top_n |
Integer. For ranking-based methods, keep this many top features (default 50). |
parallel |
Logical. Use future-based parallelism for the embarrassingly parallel parts. |
seed |
Optional integer for reproducibility. |
... |
Additional arguments passed to the method-specific fitter. |
An object of class 'highmlr_fit'. See [new_highmlr_fit()].
if (requireNamespace("glmnet", quietly = TRUE)) {
data(hnscc)
fit <- highmlr(hnscc, time = "OS", status = "Death",
method = "coxnet", resampling = "cv", folds = 5)
print(fit)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.