Skip to main content

dcurves

PyPI Latest Release PyPI Downloads Overall

Table of Contents

Diagnostic and prognostic models are typically evaluated with measures of accuracy that do not address clinical consequences. Decision-analytic techniques allow assessment of clinical outcomes, but often require collection of additional information that may be cumbersome to apply to models that yield continuous results.

Decision Curve Analysis is a method for evaluating and comparing prediction models that incorporates clinical consequences, requiring only the data set on which the models are tested, and can be applied to models that have either continuous or dichotomous results.

Functions

dcurves is a Python package for performing Decision Curve Analysis (DCA). It evaluates and compares prediction models for both binary and survival outcomes.

Main functions:

  • dca(): Performs Decision Curve Analysis, calculating net benefit and interventions avoided
  • plot_graphs(): Visualizes DCA results

Quick-and-dirty Library Documentation

https://mskcc-epi-bio.github.io/dcurves/

Simple Tutorial

This tutorial will guide you through installing and using the dcurves package to perform Decision Curve Analysis (DCA) with sample cancer diagnosis data.

Installation (bash)

# Install dcurves for DCA
pip install dcurves

DCA Example

# Import Libraries
from dcurves import dca, plot_graphs
import pandas as pd
import numpy as np

# Load Sample Data (or use your own)
df_binary = pd.read_csv(
    "https://raw.githubusercontent.com/MSKCC-Epi-Bio/dcurves/main/dcurves/data/df_binary.csv"
)

# Perform Decision Curve Analysis
df_dca = dca(
    data=df_binary,
    outcome='cancer',
    modelnames=['famhistory'],
    thresholds=np.arange(0, 0.36, 0.01),
)

# Standard DCA Plot
plot_graphs(
    plot_df=df_dca,
    graph_type='net_benefit',
    y_limits=[-0.05, 0.2]
)

DCA Plot

In-depth Tutorial and Explanations with Examples, Relevant Literature, and Forumn for Personalized Help

Visit https://www.decisioncurveanalysis.org

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Contributors

License

Apache 2.0

Metadata

Release files for dcurves 1.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dcurves 1.1.7
File Size Uploaded
dcurves-1.1.7.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for dcurves 1.1.7
File Interpreter ABI Platform
dcurves-1.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 4.2 MB

Release files / dcurves-1.1.7.tar.gz

Download URL dcurves-1.1.7.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
95d744b29a0cdd59ac5048e71aed96dc664eda96608d810566ff5fd955613c7f
BLAKE2b-256 checksum
How to use checksums
c5cbf2a05bd0b23e23addbcb84e3e181f10fd3b12e21cf01bdaf63537affb5ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.5

Release files / dcurves-1.1.7-py3-none-any.whl

Download URL dcurves-1.1.7-py3-none-any.whl
Size 91.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f85d10c3d3861c78db03b027e781b75f3d96d5541f3279357b0b621d6342feb
BLAKE2b-256 checksum
How to use checksums
9718dc60b2585baa37109b5eef85325be49956f246648dd0aaa9d7de1ad0ea2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.5

Release history Release notifications | RSS feed

This release

1.1.7 This release

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page