Fit a survival regression model under the Cox proportional hazards assumption using deep learning neural network (DNN).
deepSurv(formula, model, data, epochs = 200, lr_rate = 1e-04,
batch_size = 64, alpha = 0.7, lambda = 1, verbose = 0,
weights = NULL, ...)
An object of class "deepSurv" is returned. The deepSurv object contains the following list components:
Covariates for Cox model
Surv object for Cox model
dnn model
predictor score mu = f(x)
risk score = exp(predictor)
a formula expression as for other regression models. The response is usually a survival object as returned by the 'Surv' function. See the documentation for 'Surv', 'lm' and 'formula' for details.
a deep neural network model, created by function dNNmodel().
a data.frame in which to interpret the variables named in the formula.
number of deep learning epochs, default is 200.
batch size, default is 64. 'NaN' may be generated if batch size is too small and there is not event in a batch.
learning rate for the gradient descent algorithm, default is lr_rate = 1e-04.
an optional vector of 'prior weights' to be used in the fitting process. Should be NULL or a numeric vector.
momentum rate for the gradient descent method, alpha takes value in [0, 1), default is alpha = 0.70.
L2 regularization parameter for deep learning.
verbose = 1 for print out verbose during the model fit, 0 for not print.
optional arguments
Chen, B. E. wrote the R code using the partial likelihood cost function proposed by Katzman et al (2018).
See "Deep learning with R" for details on how to build a deep learning model.
The following parameters in 'dnnControl' will be used to control the model fit process.
'epochs': number of deep learning epochs, default is 30.
'verbose': verbose = 1 for print out verbose during the model fit, 0 for not print.
'epsilon': epsilon for convergence check, default is epsilon = 0.001.
'max.iter': number of maximum iteration, default is max.iter = 30.
When the variance for covariance matrix X is too large, please use xbar = scale(x) to standardize X.
Katzman JL, Shaham U, Cloninger A, Bates J, Jiang T, Kluger Y. DeepSurv: Personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC Medical Research Methodology 2018; 18: 24.
deepAFT
, deepGlm
,
print.deepSurv
, survreg
## Example for deep learning proportional hazards survival model
set.seed(101)
### define model layers
model = dNNmodel(units = c(4, 3, 1), activation = c("elu", "sigmoid", "sigmoid"),
input_shape = 3)
x = matrix(runif(15), nrow = 5, ncol = 3)
time = exp(x[, 1])
status = c(1, 0, 1, 1, 1)
fit = deepSurv(Surv(time, status) ~ x, model = model)
Run the code above in your browser using DataLab