forked from RaphaelS1/survivalmodels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
62 lines (42 loc) · 3.35 KB
/
README.Rmd
File metadata and controls
62 lines (42 loc) · 3.35 KB
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)
```
[](https://cran.r-project.org/package=survivalmodels)
[](https://cran.r-project.org/web/checks/check_results_survivalmodels.html)
[](https://github.com/RaphaelS1/survivalmodels/actions)
[](https://www.codefactor.io/repository/github/raphaels1/survivalmodels)
[](https://github.com/RaphaelS1/survivalmodels)
[](https://github.com/RaphaelS1/survivalmodels)
[](https://cran.r-project.org/package=survivalmodels)
[](https://codecov.io/gh/RaphaelS1/survivalmodels)
[](https://CRAN.R-project.org/package=survivalmodels)
[](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")
```