forked from RaphaelS1/survivalmodels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
62 lines (42 loc) · 3.35 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: "survivalmodels"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(survivalmodels)
set.seed(42)
```
[![CRAN Status Badge](https://www.r-pkg.org/badges/version-ago/survivalmodels)](https://cran.r-project.org/package=survivalmodels)
[![CRAN Checks](https://cranchecks.info/badges/worst/survivalmodels)](https://cran.r-project.org/web/checks/check_results_survivalmodels.html)
[![tic](https://github.com/RaphaelS1/survivalmodels/workflows/tic/badge.svg)](https://github.com/RaphaelS1/survivalmodels/actions)
[![CodeFactor](https://www.codefactor.io/repository/github/raphaels1/survivalmodels/badge)](https://www.codefactor.io/repository/github/raphaels1/survivalmodels)
[![Repo Status](https://www.repostatus.org/badges/latest/active.svg)](https://github.com/RaphaelS1/survivalmodels)
[![Lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://github.com/RaphaelS1/survivalmodels)
[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/survivalmodels)](https://cran.r-project.org/package=survivalmodels)
[![codecov](https://codecov.io/gh/RaphaelS1/survivalmodels/branch/master/graph/badge.svg)](https://codecov.io/gh/RaphaelS1/survivalmodels)
[![dependencies](https://tinyverse.netlify.com/badge/survivalmodels)](https://CRAN.R-project.org/package=survivalmodels)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
## 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](https://github.com/havakv/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](https://towardsdatascience.com/neural-networks-for-survival-analysis-in-r-1e0421584ab?source=friends_link&sk=e978a1b30a4da3370bea930e169326f3) I wrote, which uses the [mlr3proba](https://github.com/mlr-org/mlr3proba) interface with models from `survivalmodels`.
## Python Models
`survivalmodels` implements models from Python using [reticulate](https://cran.r-project.org/package=reticulate). In order to use these models, the required Python packages must be installed following with [reticulate::py_install](https://rstudio.github.io/reticulate/reference/py_install.html). `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
```{r eval=FALSE}
install_pycox(pip = TRUE, install_torch = FALSE)
```
With the arguments changed as you require, see [?install_pycox](https://raphaels1.github.io/survivalmodels/reference/install_pycox.html) for more.
For `DNNSurv` the model depends on `keras` and `tensorflow`, which require installation via:
```{r eval=FALSE}
install_keras(pip = TRUE, install_tensorflow = FALSE)
```
## Installation
Install the latest release from CRAN:
```{r eval=FALSE}
install.packages("survivalmodels")
```
Install the development version from GitHub:
```{r eval=FALSE}
remotes::install_github("RaphaelS1/survivalmodels")
```