DynForest

Random forest with multivariate longitudinal predictors

https://github.com/anthonydevaux/dynforest

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.4%) to scientific vocabulary

Keywords from Contributors

transformation
Last synced: 10 months ago · JSON representation

Repository

Random forest with multivariate longitudinal predictors

Basic Info
  • Host: GitHub
  • Owner: anthonydevaux
  • License: other
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 3.81 MB
Statistics
  • Stars: 17
  • Watchers: 2
  • Forks: 3
  • Open Issues: 1
  • Releases: 4
Created over 5 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```


[![CRAN status](https://www.r-pkg.org/badges/version-last-release/DynForest)](https://CRAN.R-project.org/package=DynForest)
[![Downloads](https://cranlogs.r-pkg.org/badges/DynForest?color=blue)](https://www.r-pkg.org/pkg/DynForest)


## Description

`DynForest` is a R package aiming to predict an outcome using multivariate longitudinal predictors. The method is based on random forest principle where the longitudinal predictors are modeled through the random forest. `DynForest` currently supports continuous, categorical and survival outcome. The methodology is fully described for a survival outcome in the paper:

> Devaux A., Helmer C., Genuer R. and Proust-Lima C. (2023). Random survival forests with multivariate longitudinal endogenous covariates. _Statistical Methods in Medical Research_. [](https://doi.org/10.1177/09622802231206477)

`DynForest` user guide is also available in the paper: 

> Devaux A., Proust-Lima C. and Genuer R. (2023). Random Forests for time-fixed and time-dependent predictors: The DynForest R package. _arXiv_.  [](https://doi.org/10.48550/arXiv.2302.02670)

## Installation

`DynForest` package version 1.2.0 could be install from the [CRAN](https://cran.r-project.org/package=DynForest) with:

```{r, eval = FALSE}
install.packages("DynForest")
```

Development version of `DynForest` is also available from [GitHub](https://github.com/anthonydevaux/DynForest) with:

```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("anthonydevaux/DynForest")
```

## Quick example with survival outcome

### Manage data

```{r}
library(DynForest)
data(pbc2)

# Get Gaussian distribution for longitudinal predictors
pbc2$serBilir <- log(pbc2$serBilir)
pbc2$SGOT <- log(pbc2$SGOT)
pbc2$albumin <- log(pbc2$albumin)
pbc2$alkaline <- log(pbc2$alkaline)
```

### Build DynForest objects

```{r}
# Build longitudinal data
timeData <- pbc2[,c("id","time",
                    "serBilir","SGOT",
                    "albumin","alkaline")]

# Create object with longitudinal association for each predictor
timeVarModel <- list(serBilir = list(fixed = serBilir ~ time,
                                     random = ~ time),
                     SGOT = list(fixed = SGOT ~ time + I(time^2),
                                 random = ~ time + I(time^2)),
                     albumin = list(fixed = albumin ~ time,
                                    random = ~ time),
                     alkaline = list(fixed = alkaline ~ time,
                                     random = ~ time))
# Build fixed data
fixedData <- unique(pbc2[,c("id","age","drug","sex")])

# Build outcome data
Y <- list(type = "surv",
          Y = unique(pbc2[,c("id","years","event")]))
```

### Run `dynforest()` function

```{r}
# Run DynForest function
res_dyn <- dynforest(timeData = timeData, fixedData = fixedData,
                     timeVar = "time", idVar = "id",
                     timeVarModel = timeVarModel, Y = Y,
                     ntree = 50, nodesize = 5, minsplit = 5,
                     cause = 2, ncores = 15, seed = 1234)
```

### Get summary

```{r}
summary(res_dyn)
```

Owner

  • Name: Anthony Devaux, PhD
  • Login: anthonydevaux
  • Kind: user
  • Location: Sydney, Australia
  • Company: The George Institute for Global Health

Biostatistician

GitHub Events

Total
  • Create event: 2
  • Issues event: 3
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 25
  • Fork event: 1
Last Year
  • Create event: 2
  • Issues event: 3
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 25
  • Fork event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 117
  • Total Committers: 2
  • Avg Commits per committer: 58.5
  • Development Distribution Score (DDS): 0.368
Top Committers
Name Email Commits
anthonydevaux 3****x@u****m 74
anthonydevaux 43

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 12
  • Total pull requests: 2
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 3 months
  • Total issue authors: 9
  • Total pull request authors: 2
  • Average comments per issue: 1.58
  • Average comments per pull request: 0.5
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: 5 days
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ChenXinaha (3)
  • anthonydevaux (2)
  • instantkaffee (1)
  • rahuljosephfernandez (1)
  • jmanacup (1)
  • snvv (1)
  • Diego-FB (1)
  • bernard-liew (1)
  • CathLab21 (1)
Pull Request Authors
  • quentinlaval (2)
  • anthonydevaux (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels
bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 368 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 6
  • Total maintainers: 1
cran.r-project.org: DynForest

Random Forest with Multivariate Longitudinal Predictors

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 368 Last month
Rankings
Stargazers count: 21.1%
Forks count: 28.8%
Dependent packages count: 29.8%
Average: 33.5%
Dependent repos count: 35.5%
Downloads: 52.3%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • DescTools * imports
  • cmprsk * imports
  • doParallel * imports
  • foreach * imports
  • ggplot2 * imports
  • lcmm * imports
  • methods * imports
  • pbapply * imports
  • pec * imports
  • prodlim * imports
  • stringr * imports
  • survival * imports
  • zoo * imports
  • knitr * suggests
  • rmarkdown * suggests
.github/workflows/check-standard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/render-rmarkdown.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-renv v2 composite