random-survival-forest

A Random Survival Forest implementation for python inspired by Ishwaran et al. - Easily understandable, adaptable and extendable.

https://github.com/julianspaeth/random-survival-forest

Science Score: 64.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary

Keywords

machine-learning python random-forest random-survival-forests survival-analysis survival-prediction
Last synced: 6 months ago · JSON representation ·

Repository

A Random Survival Forest implementation for python inspired by Ishwaran et al. - Easily understandable, adaptable and extendable.

Basic Info
  • Host: GitHub
  • Owner: julianspaeth
  • License: other
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 85 KB
Statistics
  • Stars: 60
  • Watchers: 2
  • Forks: 9
  • Open Issues: 0
  • Releases: 14
Topics
machine-learning python random-forest random-survival-forests survival-analysis survival-prediction
Created over 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Random Survival Forest

DOI

The Random Survival Forest package provides a python implementation of the survival prediction method originally published by Ishwaran et al. (2008).

Reference: Ishwaran, H., Kogalur, U. B., Blackstone, E. H., & Lauer, M. S. (2008). Random survival forests. The annals of applied statistics, 2(3), 841-860.

Installation

sh $ pip install random-survival-forest

Contribute

  • Source Code: https://github.com/julianspaeth/random-survival-forest

Performance

This implemention is not optimized for being highly performant. It is programmed in pure python. If you have large datasets (large sample size) or use a very high number of trees, I suggest using the scikit-survival package.

Getting Started

```python import time

from lifelines import datasets from sklearn.modelselection import traintest_split

from randomsurvivalforest.models import RandomSurvivalForest from randomsurvivalforest.scoring import concordance_index

rossi = datasets.load_rossi()

Attention: duration column (time until event occurs) must be index 1, event column index 0 in y

y = rossi.loc[:, ["arrest", "week"]] X = rossi.drop(["arrest", "week"], axis=1) X, Xtest, y, ytest = traintestsplit(X, y, testsize=0.33, randomstate=10)

print("Start training...") starttime = time.time() rsf = RandomSurvivalForest(nestimators=10, njobs=-1, randomstate=10) rsf = rsf.fit(X, y) print(f'--- {round(time.time() - starttime, 3)} seconds ---') ypred = rsf.predict(Xtest) cval = concordanceindex(ytime=ytest["week"], ypred=ypred, yevent=ytest["arrest"]) print(f'C-index {round(cval, 3)}') ```

Feedback

If you are having issues or feedback, please let me know. I am happy to fix some bug or implement feature requests.

julian.alexander.spaeth@uni-hamburg..de

This package is open-source. If it helped you or you even use it comercially, I would be happy about a little support:

"Buy Me A Coffee"

License

MIT

Owner

  • Name: Julian Späth
  • Login: julianspaeth
  • Kind: user
  • Location: Germany
  • Company: @FeatureCloud

PHD Student @CosyBio @UHH

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Späth
    given-names: Julian
    orcid: https://orcid.org/0000-0003-4562-5816
title: Random Survival Forest
doi: 10.5281/zenodo.5146376
version: v0.1.2-beta

GitHub Events

Total
  • Watch event: 5
  • Push event: 1
  • Fork event: 1
Last Year
  • Watch event: 5
  • Push event: 1
  • Fork event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 61
  • Total Committers: 3
  • Avg Commits per committer: 20.333
  • Development Distribution Score (DDS): 0.525
Top Committers
Name Email Commits
Julian Späth s****u@p****e 29
Julian Späth S****u@p****e 25
Julian Späth j****h@w****e 7
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 8
  • Total pull requests: 6
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 2 days
  • Total issue authors: 8
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • willthd (1)
  • AtlasGao (1)
  • mathewrosssmith (1)
  • aaby4373 (1)
  • mufassir-khan (1)
  • FabioRovai (1)
  • pancratm (1)
  • heavycello (1)
Pull Request Authors
  • julianspaeth (6)
Top Labels
Issue Labels
bug (2) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 139 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 14
  • Total maintainers: 1
pypi.org: random-survival-forest

A Random Survival Forest implementation inspired by Ishwaran et al.

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 139 Last month
Rankings
Stargazers count: 9.1%
Dependent packages count: 10.1%
Forks count: 11.4%
Average: 15.1%
Dependent repos count: 21.6%
Downloads: 23.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • joblib *
  • lifelines *
  • multiprocess *
  • numpy *
  • pandas *
  • scikit-learn *
setup.py pypi
  • get *
  • joblib *
  • lifelines *
  • multiprocess *
  • numpy *
  • pandas *
  • scikit-learn *
.github/workflows/pylint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite