Skip to main content

A Python package for Decision Curve Analysis to evaluate prediction models, molecular markers, and diagnostic tests.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dcurves-1.1.7.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dcurves-1.1.7-py3-none-any.whl (91.8 kB view details)

Uploaded Python 3

File details

Details for the file dcurves-1.1.7.tar.gz.

File metadata

  • Download URL: dcurves-1.1.7.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for dcurves-1.1.7.tar.gz
Algorithm Hash digest
SHA256 95d744b29a0cdd59ac5048e71aed96dc664eda96608d810566ff5fd955613c7f
MD5 8d539d898220ebb4be2e75296dade02f
BLAKE2b-256 c5cbf2a05bd0b23e23addbcb84e3e181f10fd3b12e21cf01bdaf63537affb5ea

See more details on using hashes here.

File details

Details for the file dcurves-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: dcurves-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 91.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for dcurves-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4f85d10c3d3861c78db03b027e781b75f3d96d5541f3279357b0b621d6342feb
MD5 0182fdd7561bea8cd5cbaf51d648ae19
BLAKE2b-256 9718dc60b2585baa37109b5eef85325be49956f246648dd0aaa9d7de1ad0ea2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page