tunePLANN | R Documentation |
This function finds the optimal inter, size, decay, maxit, and MaxNWts parameters for the survival neural network by using cross-validation and the concordance index.
tunePLANN(times, failures, group=NULL, cov.quanti=NULL, cov.quali=NULL,
data, cv=10, inter, size, decay, maxit, MaxNWts, 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. |
inter |
The length of the intervals. |
size |
The number of units in the hidden layer. |
decay |
The parameter for weight decay. |
maxit |
The maximum number of iterations. |
MaxNWts |
The maximum allowable number of weights. |
seed |
A numeric value for random seed for reproducibility. The default is |
This function is based is based on the survivalPLANN
package.
optimal |
The value of |
results |
The data frame with the mean cross-validated C-index according to |
Biganzoli E, Boracchi P, Mariani L, and et al. Feed forward neural networks for the analysis of censored survival data: a partial logistic regression approach. Stat Med, 17:1169-86, 1998.
data(dataDIVAT2)
# The hyper-parameter grid needs to be more precise and the maximum number
# of iterations > 1000. We have reduced the arguments to respect examples requiring
# less than 5 seconds for packages on the CRAN.
tune.model <- tunePLANN(times="times", failures="failures", data=dataDIVAT2[1:300,],
cov.quanti=c("age"), cov.quali=c("hla", "retransplant", "ecd"), cv=3,
inter=1, size=c(16, 32), decay=0.01, maxit=50, MaxNWts=10000, seed=42)
tune.model$optimal # the optimal hyperparameters
tune.model$results # the C-index for the tested grid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.