Skip to main content

Compute ROC AUC and confidence intervals using DeLong’s method

Project description

pAUC Logo

pAUC: A simple Python package to calculate ROC AUC confidence intervals using DeLong’s method


PyPI Python Python Tests Repo Size


📌 Installation

pip install pauc

📌 Quick Usage

from pauc import roc_auc_ci_score
import numpy as np

y_true = np.array([0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1])
y_pred = np.array([0.1, 0.35, 0.24, 0.8, 0.2, 0.85, 0.13, 0.85, 0.74, 0.58, 0.71, 0.25])

auc, (lb, ub) = roc_auc_ci_score(y_true, y_pred)
print(f'AUC: {auc:.3f}, 95% CI: ({lb:.3f}, {ub:.3f})')
AUC: 0.708
95% CI: (0.378, 1.000)

📌 Comparing Two Models

from pauc.roc_auc_ci import delong_roc_test
import numpy as np

y_true = np.array([0, 0, 1, 1, 0, 1, 0])
pred1 = np.array([0.1, 0.35, 0.4, 0.8, 0.2, 0.75, 0.1])
pred2 = np.array([0.5, 0.92, 0.1, 0.1, 0.8, 0.95, 0.9])

log_pval = delong_roc_test(y_true, pred1, pred2)
p_value = 10 ** log_pval
print(f"DeLong’s test p-value: {p_value}")

📌 Why DeLong’s Test?

DeLong’s method (DeLong et al. 1988, Sun and Xu 2014) is:

  • 📈 Statistically robust and widely used
  • ✅ Ideal for estimating AUC confidence intervals
  • 🔁 Suitable for comparing correlated ROC curves

📌 Citation

If you use pAUC, please cite:

  • DeLong et al., Biometrics, 1988:
    Comparing the areas under two or more correlated ROC curves: a nonparametric approach

  • Sun & Xu, IEEE Signal Processing Letters, 2014:
    Fast Implementation of DeLong’s Algorithm for Comparing the Areas Under Correlated ROC Curves


📌 License

Released under the MIT License.


Enjoy using pAUC for statistically sound AUC comparisons!

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

pauc-0.1.5.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

pauc-0.1.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pauc-0.1.5.tar.gz.

File metadata

  • Download URL: pauc-0.1.5.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for pauc-0.1.5.tar.gz
Algorithm Hash digest
SHA256 1ba52fc7862e7a741f39ea873f84e0353186b3d05a0f7fb4ec94cce59026b54c
MD5 50dbae0fc24f6d06ec3e29418caeb233
BLAKE2b-256 a1edf7c7869780ffa01da42a94c4e58f091f4411afb6a47e295eb4fe1c955137

See more details on using hashes here.

File details

Details for the file pauc-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pauc-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for pauc-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ed9c71da9c81e44dcfd6cac12a83ab12dea90c7011d5f4b09f59db7d0a799cbe
MD5 b7ac7a3eb0028474b797b3fedd423317
BLAKE2b-256 d806fc4a5fbbf948b9635ea6ed7d272a8f9c5b9c204f53c2c1ed647795e9426e

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