| tuneSNN | R Documentation |
This function finds the optimal n.nodes, decay, batch.size, and epochs parameters for a survival neural network.
tuneSNN(times, failures, group=NULL, cov.quanti=NULL, cov.quali=NULL,
data, cv=10, n.nodes, decay, batch.size, epochs, seed=NULL)
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 |
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 ( |
cv |
The value of the number of folds. The default value is 10. |
n.nodes |
The number of hidden nodes optimized over. |
decay |
The value of the weight decay optimized over. |
batch.size |
The value of batch size. |
epochs |
The value of epochs. |
seed |
A numeric value for random seed for reproducibility. The default is |
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.
optimal |
The value of |
results |
The data frame with the mean cross-validated C-index according to |
Katzman et al. DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC Medical Research Methodology, 18(1), 24. 1018.
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.