A package for comparing ROC AUC scores using DeLong's method.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rocauc_comparison-0.1.1.tar.gz.
File metadata
- Download URL: rocauc_comparison-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c115ca47db8c6a984d96d617add2677a5140bd45825c8818b8274327f207d36
|
|
| MD5 |
a17b30044763041c259f196926b789f1
|
|
| BLAKE2b-256 |
6532f6b1525ae1c104a394a527e5b9359dd5ea48f25c80af48cdad38a091751b
|
File details
Details for the file rocauc_comparison-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rocauc_comparison-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43db0fa2069d9fc766fa0db7aefd4bf98c72a5a5f75a0400e529aadcab9f25f
|
|
| MD5 |
6914e8bcc9efdce0094693508eb919e9
|
|
| BLAKE2b-256 |
4bb0c4b25e9248aeb898a5c0579d8371fd63ea7015dd4c1902e3534f449df61f
|