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)
The value of n.nodes
, decay
, batch.size
, and epochs
that gives the maximum mean cross-validated C-index.
The data frame with the mean cross-validated C-index according to n.nodes
, decay
, batch.size
, and epochs
.
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 value of the number of folds. The default value is 10.
The number of hidden nodes optimized over.
The value of the weight decay optimized over.
The value of batch size.
The value of epochs.
A numeric value for random seed for reproducibility. The default is NULL
.
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 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