Learn R Programming

⚠️There's a newer version (0.1.191) of this package.Take me there.

survivalmodels

What is survivalmodels?

survivalmodels implements models for survival analysis that are either not already implemented in R, or novel implementations for speed improvements. Currently implemented are five neural networks from the Python packages pycox, DNNSurv, and the Akritas non-parametric conditional estimator. Further updates will include implementations of novel survival models.

For a hands-on demonstration of model training, tuning, and comparison see this article I wrote, which uses the mlr3proba interface with models from survivalmodels.

Python Models

survivalmodels implements models from Python using reticulate. In order to use these models, the required Python packages must be installed following with reticulate::py_install. survivalmodels includes a helper function to install the required pycox function (with pytorch if also required). Before running any models in this package, if you have not already installed pycox please run

install_pycox(pip = TRUE, install_torch = FALSE)

With the arguments changed as you require, see ?install_pycox for more.

For DNNSurv the model depends on keras and tensorflow, which require installation via:

install_keras(pip = TRUE, install_tensorflow = FALSE)

Installation

Install the latest release from CRAN:

install.packages("survivalmodels")

Install the development version from GitHub:

remotes::install_github("RaphaelS1/survivalmodels")

Copy Link

Version

Install

install.packages('survivalmodels')

Monthly Downloads

439

Version

0.1.9

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Raphael Sonabend

Last Published

September 11th, 2021

Functions in survivalmodels (0.1.9)

cindex

Compute Concordance of survivalmodel Risk
dnnsurv

DNNSurv Neural Network for Conditional Survival Probabilities
coxtime

Cox-Time Survival Neural Network
get_pycox_activation

Get Pytorch Activation Function
build_pytorch_net

Build a Pytorch Multilayer Perceptron
deephit

DeepHit Survival Neural Network
get_keras_optimizer

Get Keras Optimizer
deepsurv

DeepSurv Survival Neural Network
akritas

Akritas Conditional Non-Parametric Survival Estimator
build_keras_net

Build a Keras Multilayer Perceptron
get_pycox_optim

Get Pytorch Optimizer
pchazard

PC-Hazard Survival Neural Network
loghaz

Logistic-Hazard Survival Neural Network
requireNamespaces

Vectorised Logical requireNamespace
set_seed

Set seed in R numpy and torch
install_keras

Install Keras and Tensorflow
predict.dnnsurv

Predict Method for DNNSurv
predict.akritas

Predict method for Akritas Estimator
install_pycox

Install Pycox With Reticulate
pycox_prepare_train_data

Prepare Data for Pycox Model Training
predict.pycox

Predict Method for pycox Neural Networks
install_torch

Install Torch With Reticulate
get_pycox_init

Get Pytorch Weight Initialization Method
survivalmodels-package

survivalmodels: Models for Survival Analysis
get_pycox_callbacks

Get Torchtuples Callbacks
simsurvdata

Simulate Survival Data