tuneSNN {survivalSL}R Documentation

Tune a 1-Layer Survival Neural Network

Description

This function finds the optimal n.nodes, decay, batch.size, and epochs parameters for a survival neural network.

Usage

tuneSNN(times, failures, group=NULL, cov.quanti=NULL, cov.quali=NULL,
data, cv=10, n.nodes, decay, batch.size, epochs)

Arguments

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 (times), the event (failures), the optional treatment/exposure (group) and the covariables included in the previous model (cov.quanti and cov.quali).

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

Details

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.

Value

optimal

The value of n.nodes, decay, batch.size, and epochs that gives the maximum mean cross-validated C-index.

results

The data frame with the mean cross-validated C-index according to n.nodes, decay, batch.size, and epochs.

References

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


[Package survivalSL version 0.94 Index]