  In survival analysis, prediction models are needed as stand-alone tools and
in applications of causal inference to estimate nuisance parameters. The super
learner is a machine learning algorithm which combines a library of prediction
models into a meta learner based on cross-validated loss. In right-censored
data, the choice of the loss function and the estimation of the expected loss
need careful consideration. We introduce the state learner, a new super learner
for survival analysis, which simultaneously evaluates libraries of prediction
models for the event of interest and the censoring distribution. The state
learner can be applied to all types of survival models, works in the presence
of competing risks, and does not require a single pre-specified estimator of
the conditional censoring distribution. We establish an oracle inequality for
the state learner and investigate its performance through numerical
experiments. We illustrate the application of the state learner with prostate
cancer data, as a stand-alone prediction tool, and, for causal inference, as a
way to estimate the nuisance parameter models of a smooth statistical
functional.
