DeepSurv neural fits a neural network based on the partial likelihood from a Cox PH.
deepsurv(
formula = NULL,
data = NULL,
reverse = FALSE,
time_variable = "time",
status_variable = "status",
x = NULL,
y = NULL,
frac = 0,
activation = "relu",
num_nodes = c(32L, 32L),
batch_norm = TRUE,
dropout = NULL,
device = NULL,
early_stopping = FALSE,
best_weights = FALSE,
min_delta = 0,
patience = 10L,
batch_size = 256L,
epochs = 1L,
verbose = FALSE,
num_workers = 0L,
shuffle = TRUE,
...
)(formula(1))
Object specifying the model fit, left-hand-side of formula should describe a survival::Surv()
object.
(data.frame(1))
Training data of data.frame like object, internally is coerced with stats::model.matrix().
(logical(1))
If TRUE fits estimator on censoring distribution, otherwise (default) survival distribution.
(character(1))
Alternative method to call the function. Name of the 'time' variable, required if formula.
or x and Y not given.
(character(1))
Alternative method to call the function. Name of the 'status' variable, required if formula
or x and Y not given.
(data.frame(1))
Alternative method to call the function. Required if formula, time_variable and
status_variable not given. Data frame like object of features which is internally
coerced with model.matrix.
([survival::Surv()])
Alternative method to call the function. Required if formula, time_variable and
status_variable not given. Survival outcome of right-censored observations.
(numeric(1))
Fraction of data to use for validation dataset, default is 0 and therefore no separate
validation dataset.
(character(1))
See get_pycox_activation.
(integer()/logical(1)/numeric(1))
See build_pytorch_net.
(integer(1)|character(1))
Passed to pycox.models.CoxPH, specifies device to compute models on.
(logical(1)/logical(1)/numeric(1)/integer(1)
See get_pycox_callbacks.
(integer(1))
Passed to pycox.models.CoxPH.fit, elements in each batch.
(integer(1))
Passed to pycox.models.CoxPH.fit, number of epochs.
(logical(1))
Passed to pycox.models.CoxPH.fit, should information be displayed during
fitting.
(integer(1))
Passed to pycox.models.CoxPH.fit, number of workers used in the
dataloader.
(logical(1))
Passed to pycox.models.CoxPH.fit, should order of dataset be shuffled?
ANY
Passed to get_pycox_optim.
An object inheriting from class deepsurv.
An object of class survivalmodel.
Implemented from the pycox Python package via reticulate.
Calls pycox.models.CoxPH.
Katzman, J. L., Shaham, U., Cloninger, A., Bates, J., Jiang, T., & Kluger, Y. (2018). DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC Medical Research Methodology, 18(1), 24. https://doi.org/10.1186/s12874-018-0482-1
# \donttest{
if (requireNamespaces("reticulate")) {
# all defaults
deepsurv(data = simsurvdata(50))
# common parameters
deepsurv(data = simsurvdata(50), frac = 0.3, activation = "relu",
num_nodes = c(4L, 8L, 4L, 2L), dropout = 0.1, early_stopping = TRUE, epochs = 100L,
batch_size = 32L)
}
#> Error in py_module_import(module, convert = convert): ModuleNotFoundError: No module named 'pycox'
#> Run `reticulate::py_last_error()` for details.
# }