DNNSurv neural fits a neural network based on pseudo-conditional survival probabilities.
dnnsurv(
formula = NULL,
data = NULL,
reverse = FALSE,
time_variable = "time",
status_variable = "status",
x = NULL,
y = NULL,
cutpoints = NULL,
cuts = 5L,
custom_model = NULL,
loss_weights = NULL,
weighted_metrics = NULL,
optimizer = "adam",
early_stopping = FALSE,
min_delta = 0,
patience = 0L,
verbose = 0L,
baseline = NULL,
restore_best_weights = FALSE,
batch_size = 32L,
epochs = 10L,
validation_split = 0,
shuffle = TRUE,
sample_weight = NULL,
initial_epoch = 0L,
steps_per_epoch = NULL,
validation_steps = NULL,
...
)
(formula(1))
Object specifying the model fit, left-hand-side of formula should describe a survival::Surv()
object.
(data.frame(1))
Training data of data.frame
like object, internally is coerced with stats::model.matrix()
.
(logical(1))
If TRUE
fits estimator on censoring distribution, otherwise (default) survival distribution.
(character(1))
Alternative method to call the function. Name of the 'time' variable, required if formula
.
or x
and Y
not given.
(character(1))
Alternative method to call the function. Name of the 'status' variable, required if formula
or x
and Y
not given.
(data.frame(1))
Alternative method to call the function. Required if formula, time_variable
and
status_variable
not given. Data frame like object of features which is internally
coerced with model.matrix
.
([survival::Surv()])
Alternative method to call the function. Required if formula, time_variable
and
status_variable
not given. Survival outcome of right-censored observations.
(numeric())
Points at which to cut survival time into discrete points.
(integer(1))
If cutpoints
not provided then number of equally spaced points at which to cut survival time.
(keras.engine.training.Model(1))
Optional custom architecture built with build_keras_net or directly with keras.
Output layer should be of length 1
input is number of features plus number of cuts.
(character(1))
See get_keras_optimizer.
(logical(1))
If TRUE
then early stopping callback is included.
(integer(1))
Level of verbosity for printing, 0
or 1
.
See keras::fit.keras.engine.training.Model. # nolint
ANY
Passed to get_keras_optimizer.
An object of class survivalmodel
.
Code for generating the conditional probabilities and pre-processing data is taken from https://github.com/lilizhaoUM/DNNSurv.
Zhao, L., & Feng, D. (2020). DNNSurv: Deep Neural Networks for Survival Analysis Using Pseudo Values. https://arxiv.org/abs/1908.02337
# NOT RUN {
if (requireNamespaces(c("keras", "pseudo")))
# all defaults
dnnsurv(data = simsurvdata(10))
# setting common parameters
dnnsurv(time_variable = "time", status_variable = "status", data = simsurvdata(10),
early_stopping = TRUE, epochs = 100L, validation_split = 0.3)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab