rocauc_comparison
rocauc_comparison is a Python package designed for comparing Receiver Operating Characteristic (ROC) Area Under the Curve (AUC) scores using DeLong's method. This package provides a statistical test to determine if the difference between two ROC AUC scores is statistically significant.
Features
- Compare Two ROC AUC Scores: Use DeLong's test to compare the ROC AUC scores of two models.
- Calculate AUC Variance: Compute the variance of a single ROC AUC score using DeLong's method.
- Fast and Efficient: Implemented with optimized numpy operations for efficient computation.
Installation
You can install the package using pip:
pip install rocauc_comparison
Usage
import numpy as np
from rocauc_comparison import delong_roc_test
# Ground truth labels
ground_truth = np.array([0, 1, 0, 1, 0, 1])
# Predictions from the first model
predictions_one = np.array([0.1, 0.4, 0.35, 0.8, 0.5, 0.9])
# Predictions from the second model
predictions_two = np.array([0.05, 0.45, 0.3, 0.7, 0.6, 0.85])
# Compare the two ROC AUC scores
result = delong_roc_test(ground_truth, predictions_one, predictions_two)
print(f"p-value: {result.p_value}")
print(f"log10(p-value): {result.log10_p_value}")
delong_roc_test returns a DelongTestResult named tuple with both the raw p-value and its base-10 logarithm.
Acknowledgments
Thanks to David Sánchez (Hospital Clínic de Barcelona) for spotting that earlier versions only documented the p-value while the function returned log10(p-value). The library now returns both values explicitly.
Metadata
Release files for rocauc-comparison 0.1.1
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 |
|---|---|---|---|---|
| rocauc_comparison-0.1.1.tar.gz | 3.3 kB | Without provenance | Details for rocauc_comparison-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rocauc_comparison-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for rocauc_comparison-0.1.1-py3-none-any.whl |
Total release size: 7.0 kB
Release files / rocauc_comparison-0.1.1.tar.gz
| Download URL | rocauc_comparison-0.1.1.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c115ca47db8c6a984d96d617add2677a5140bd45825c8818b8274327f207d36
|
|
BLAKE2b-256 checksum How to use checksums |
6532f6b1525ae1c104a394a527e5b9359dd5ea48f25c80af48cdad38a091751b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.0
|
Release files / rocauc_comparison-0.1.1-py3-none-any.whl
| Download URL | rocauc_comparison-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b43db0fa2069d9fc766fa0db7aefd4bf98c72a5a5f75a0400e529aadcab9f25f
|
|
BLAKE2b-256 checksum How to use checksums |
4bb0c4b25e9248aeb898a5c0579d8371fd63ea7015dd4c1902e3534f449df61f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.0
|
Security for rocauc-comparison 0.1.1
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.