A Python distribution of iCARE, a tool for individualized Coherent Absolute Risk Estimation.
Project description
Py-iCARE
Py-iCARE is a Python distribution of iCARE, a tool for individualized Coherent Absolute Risk Estimation. iCARE allows users to build, validate, and apply absolute risk models. Absolute risk quantifies the chance of an event occurring. For example, the likelihood that a healthy individual, of a given age and a risk factor profile, will develop the disease of interest over a specified time interval.
The original iCARE was written in R and its archived version (1.26.0) is available via Bioconductor at: https://www.bioconductor.org/packages/release/bioc/html/iCARE.html.
Motivation
The main motivation of porting iCARE from R to Python was to enable its use as a WebAssembly module (via Pyodide) for the proliferation of portable and privacy-preserving web applications that can build, validate, and apply absolute risk models. Python also enables researchers to leverage its rapidly evolving data science ecosystem— including TensorFlow, PyTorch, statsmodels, and scikit-learn— to explore novel absolute risk models that can incorporate evidence from wider sources of data.
Installation
This repository contains a Python package. It can be installed via PyPI as shown below. It is also compiled into WebAssembly via Pyodide. The wrapper JavaScript library, as ES6 modules, is also distributed in this repository at GitHub Pages. It can be accessed by any JavaScript runtime environment, including Node.js, web browsers, and Quarto notebooks in RStudio (to interface with R, Julia, and/or Python). Specifically, the steps to access it via JavaScript and R are also shown below.
Python
If you want to access iCARE from a purely Python runtime environment, you can install it via PyPI:
pip install pyicare
iCARE is supported on Python 3.7 and above.
JavaScript
ES6 import JS SDK via GitHub Pages.
R
ES6 import JS SDK via Quarto.
Usage
Once installed, Py-iCARE can be imported into your Python scripts as follows:
import icare
Py-iCARE is a library with three main functions: 1) compute_absolute_risk()
, a method to build and apply absolute risk models; 2) compute_absolute_risk_split_interval()
, a method to build and apply absolute risk models that relaxes the proportional hazard assumption to some extent by allowing you to specify different model parameters before and after a cut-point in time; and 3) validate_absolute_risk_model()
, a method to validate absolute risk models on an independent cohort study data or a case-control study nested within a cohort.
Example usages of these functions are shown in Jupyter notebooks at the examples/Python directory.
R
Quarto
JavaScript
ES6 import into script
License
Py-iCARE is open-source licensed under the MIT License.
References
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
File details
Details for the file pyicare-1.0.0.tar.gz
.
File metadata
- Download URL: pyicare-1.0.0.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87ed7fecfecb58ebed0f518e6f3722058cc2fa10c3e280e70e1a12968f9824d |
|
MD5 | 030fded7d2e8161bfff392fb7d57a852 |
|
BLAKE2b-256 | 66c7fc25e67a5d62c47581def7d26828536e384798244a2937108c1d544bfefa |
File details
Details for the file pyicare-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pyicare-1.0.0-py3-none-any.whl
- Upload date:
- Size: 36.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 962a0141a1e0c0479ef0b7e52bedfbad6d02d0bfa19b638d63f4f2c246ef3f1a |
|
MD5 | e80905b20ed5a0caf1684b6f1caedb66 |
|
BLAKE2b-256 | 5cd306e7c5120e2fb3b68faf285f042a68d7938cc5463aee7bc47215b8f36003 |