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.
If you want to access iCARE from a Python runtime environment, you can install it via PyPI:
pip install pyicare
iCARE is supported on Python 3.12 and above.
Usage
Once installed, Py-iCARE can be imported into your Python scripts as follows:
import icare
Py-iCARE is a library with three main methods:
compute_absolute_risk(): a method to build and apply absolute risk models. Based on the type of risk factors present in the model and what information is available, there can be three broad variations in using this method:- Special SNP-only absolute risk model: this variation shows you how to specify a SNP-based absolute risk model without the need to provide a reference dataset to represent the risk factor distribution of the underlying population.
- Covariate-only absolute risk model: this option shows you how to specify a risk model with any type of covariates (including classical questionnaire-based risk factors and/or SNPs) so long as a reference dataset is available to represent the distribution of all the covariates in the underlying population.
- Combined SNP and covariate absolute risk model: this option shows you how to specify a risk model that contains both SNPs and other type of covariates, such that, you have the reference dataset to represent the distribution of the covariates in the underlying population but you do not have the reference dataset to represent the SNP distribution.
- Special SNP-only absolute risk model: this variation shows you how to specify a SNP-based absolute risk model without the need to provide a reference dataset to represent the risk factor distribution of the underlying population.
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 that vary before and after a cut-point in time.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.
The Jupyter notebooks for all the use-cases described above is available at the demo directory of this repository.
iCARE for the web
Wasm-iCARE is a distribution of Py-iCARE for web applications(applications running on web browser, Node.js, RStudio's Quarto, etc.). Applications where portability and privacy is critical can make use of Wasm-iCARE. Wasm-iCARE is available at: https://github.com/jeyabbalas/wasm-icare.
License
Py-iCARE is open-source licensed under the MIT License.
References
Metadata
Release files for pyicare 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyicare-1.3.0.tar.gz | 42.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyicare-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 85.5 kB
Release files / pyicare-1.3.0.tar.gz
| Download URL | pyicare-1.3.0.tar.gz |
|---|---|
| Size | 42.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01bcb10964cfc6ce48648c6099991ce31a2d7de5cadd656e23cfc75631a7d658
|
|
BLAKE2b-256 checksum How to use checksums |
c55c818450c28125044b64c3e133214496e20d25744a0901ec439dc3c3ee28bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logRelease files / pyicare-1.3.0-py3-none-any.whl
| Download URL | pyicare-1.3.0-py3-none-any.whl |
|---|---|
| Size | 43.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cadac69dcc50d32d43fe5439525170acd9ba826b75a4f28f451f9b1506c154f2
|
|
BLAKE2b-256 checksum How to use checksums |
711c229637cef96f731af9b36e47ef7f0cd765b3947d2ce135851d73f57202db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logSecurity for pyicare 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pyicare-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.