Fit a 1-layer neural network based on the partial likelihood from a Cox proportional hazards model.
LIB_SNN(times, failures, group=NULL, cov.quanti=NULL, cov.quali=NULL,
data, n.nodes, decay, batch.size, epochs)
The estimated model.
The name of the variable related to the exposure/treatment.
The name(s) of the variable(s) related to the possible quantitative covariates.
The name(s) of the variable(s) related to the possible qualitative covariates.
The data frame used for learning. The first column is entitled times
and corresponds to the observed follow-up times. The second column is entitled failures
and corresponds to the event indicators. The other columns correspond to the predictors.
A vector of numeric values with the times of the predictions
.
A matrix with the predictions of survivals of each subject (lines) for each observed time (columns).
The name of the variable related the numeric vector with the follow-up times.
The name of the variable related the numeric vector with the event indicators (0=right censored, 1=event).
The name of the variable related to the exposure/treatment. This variable shall have only two modalities encoded 0 for the untreated/unexposed patients and 1 for the treated/exposed ones. The default value is NULL: no specific exposure/treatment is considered. When a specific exposure/treatment is considered, it will be forced in the algorithm or related interactions will be tested when possible.
The name(s) of the variable(s) related to the possible quantitative covariates. These variables must be numeric.
The name(s) of the variable(s) related to the possible qualitative covariates. These variables must be numeric with two levels: 0 and 1. A complete disjunctive form must be used for covariates with more levels.
A data frame for training the model in which to look for the variables related to the status of the follow-up time (times
), the event (failures
), the optional treatment/exposure (group
) and the covariables included in the previous model (cov.quanti
and cov.quali
).
The number of hidden nodes.
The value of the weight decay.
The value of batch size.
The value of epochs.
This function is based is based on the deepsurv
from the survivalmodels
package. You need to call Python using reticulate
. In order to use it, the required Python packages must be installed with reticulate::py_install
. Therefore, before running the present LIB_SNN
function, you must install and call for the reticulate
and survivalmodels
packages, and install pycox
by using the following command: install_pycox(pip = TRUE, install_torch = FALSE)
. The survivalSL
package functions without these supplementary installations if this learner is not included in the library.
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