GuanRank algorithm in Python
Project description
guanrank
Python implementation of the GuanRank hazard ranking algorithm. Assigns a continuous hazard rank to each subject in a survival dataset — higher rank means higher risk of earlier event. Ranks can be used as regression targets for machine learning models in place of raw survival times.
Citation
Huang et al. (2017). Complete hazard ranking to analyze right-censored data: An ALS survival study. PLOS Comp Bio, 15(1), 41–51. https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005887
Installation
pip install guanrank
# or with uv
uv add guanrank
Usage
Functional API
from guanrank import guanrank
T = [5.0, 3.0, 8.0, 3.0] # time-to-event or censoring times
E = [1, 1, 0, 0 ] # 1 = event, 0 = censored
ranks = guanrank(T, E)
Sklearn-style API (train/test split)
from guanrank import GuanRank
gr = GuanRank()
train_ranks = gr.fit_transform(T_train, E_train)
test_ranks = gr.transform(T_test, E_test)
fit stores the training cohort's Kaplan-Meier curve; transform scores new subjects by comparing them against the training cohort.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file guanrank-0.1.1.tar.gz.
File metadata
- Download URL: guanrank-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a7f86438f3baec1eeb62d02cf5be7e55b9c74dd39db0bddf1a3d1258f4e6410
|
|
| MD5 |
fb11469f67e5a46f93f23b35b1acc198
|
|
| BLAKE2b-256 |
6e8f789b81dd97e36511dc345167d647821994b3e87f237f1b161482ac506cea
|
Provenance
The following attestation bundles were made for guanrank-0.1.1.tar.gz:
Publisher:
release.yml on d-laub/guanrank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
guanrank-0.1.1.tar.gz -
Subject digest:
9a7f86438f3baec1eeb62d02cf5be7e55b9c74dd39db0bddf1a3d1258f4e6410 - Sigstore transparency entry: 1625267394
- Sigstore integration time:
-
Permalink:
d-laub/guanrank@cbb96f8179ab310b36b75af4bdcac101642f77f2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/d-laub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cbb96f8179ab310b36b75af4bdcac101642f77f2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file guanrank-0.1.1-py3-none-any.whl.
File metadata
- Download URL: guanrank-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61c91f0d7f4697498f892ed8c64c8f4c3d026cc7d9317d9f81803cf9877cb86b
|
|
| MD5 |
9a4f836ba73eb164bdf37a8473dd3fc2
|
|
| BLAKE2b-256 |
8adfdc916a4c22834b2d224c6e461ad1797bfa8df361196bc24673493e835dac
|
Provenance
The following attestation bundles were made for guanrank-0.1.1-py3-none-any.whl:
Publisher:
release.yml on d-laub/guanrank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
guanrank-0.1.1-py3-none-any.whl -
Subject digest:
61c91f0d7f4697498f892ed8c64c8f4c3d026cc7d9317d9f81803cf9877cb86b - Sigstore transparency entry: 1625267450
- Sigstore integration time:
-
Permalink:
d-laub/guanrank@cbb96f8179ab310b36b75af4bdcac101642f77f2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/d-laub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cbb96f8179ab310b36b75af4bdcac101642f77f2 -
Trigger Event:
workflow_dispatch
-
Statement type: