| LIB_SNN | R Documentation |
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)
times |
The name of the variable related the numeric vector with the follow-up times. |
failures |
The name of the variable related the numeric vector with the event indicators (0=right censored, 1=event). |
group |
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. |
cov.quanti |
The name(s) of the variable(s) related to the possible quantitative covariates. These variables must be numeric. |
cov.quali |
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. |
data |
A data frame for training the model in which to look for the variables related to the status of the follow-up time ( |
n.nodes |
The number of hidden nodes. |
decay |
The value of the weight decay. |
batch.size |
The value of batch size. |
epochs |
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.
model |
The estimated model. |
group |
The name of the variable related to the exposure/treatment. |
cov.quanti |
The name(s) of the variable(s) related to the possible quantitative covariates. |
cov.quali |
The name(s) of the variable(s) related to the possible qualitative covariates. |
data |
The data frame used for learning. The first column is entitled |
times |
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). |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.