CVD-risk-scores
A Python package for computing cardiovascular disease risk using clinically validated models.
Note: This is a work in progress
Install
This package is available on PyPI
pip install cvd-risk-scores
Getting started
CVD-risk-scores is based upon the torch philosophy of callable objects. Each RiskModel subclass is a callable upon
initialisation, taking an array-like of subjects, each defined by some variables of interest, and returning an array-like of float values corresponding to cardiovascular risk scores.
import cvd_risk_scores
# Instantiate the risk model we are interested in
risk_model = cvd_risk_scores.FraminghamRiskScore()
# Define our subject, in this case using a dictionary
subject = {
"gender": "female",
"age": 61,
"SBP_nt": 124,
"SBP_t": 0,
"TotalChol": 180,
"HDL": 47,
"smoker": True,
"diabetes": False
}
# Create a numpy array from features values
data = np.array([list(subject.values())])
# Alternatively:
#data = np.array([
# ["female", 61, 124, 0, 180, 47, True, False]
#])
# define a dictionary mapping our own column names to the names
# expected by the risk score model.
# if data is either a numpy array or a list of lists,
# the `columns_map` mapping must present the columns
# in the correct order so that data can be cast to a pandas DataFrame.
columns_map = {
"gender": "sex",
"age": "age",
"SBP_nt": "SBP_nt",
"SBP_t": "SBP_t",
"TotalChol": "tch",
"HDL": "HDL",
"smoker": "smoking",
"diabetes": "diabetes"
}
# Compute the risk score
risk_score = risk_model(data=data, columns_map=columns_map)
About
CVD-risk-scores is a Python package for computing cardiovascular disease risk using clinically validated models. It exposes an object-based API for interacting with risk models that is inspired by the torch paradigm of callable objects.
Available risk models:
- Framingham Risk Score
References
[1] D'Agostino, Ralph B Sr et al. “General cardiovascular risk profile for use in primary care: the Framingham Heart Study.” Circulation vol. 117,6 (2008): 743-53. doi:10.1161/CIRCULATIONAHA.107.699579
Metadata
Release files for cvd-risk-scores 1.0.2
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 | Actions |
|---|---|---|---|---|
| cvd_risk_scores-1.0.2.tar.gz | 8.0 kB | Without provenance | Details for cvd_risk_scores-1.0.2.tar.gz |
Release files / cvd_risk_scores-1.0.2.tar.gz
| Download URL | cvd_risk_scores-1.0.2.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
580383314f8021bdf0e57128b4cdaf026ebd91d39c7a98222d91ee36de1bd036
|
|
BLAKE2b-256 checksum How to use checksums |
3b8a6822d07a17103a154b401fc6010f0edcc384481c3e3e8fa06d73625213c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|
Security for cvd-risk-scores 1.0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.