Quickly computes the ROC AUC score of a model
Project description
fastroc
fastroc is a module that is able to approximate the ROC AUC score over an axis of two numpy arrays much faster than current alternatives. It does this at the expense of portability as it uses C to calculate the ROC AUC.
Usage
To calculate the ROC AUC score, 2 arrays are needed:
y_true
- Whether that event actually happenedy_score
- The model's score of that event happening. The lower, the more likely.y_score
should be in the range 0 to 1.
The function also takes in 3 optional arguments:
axis
(default-1
) - Which axis to compute the score overintegral_precision
(default50
) - The number of samples to use for the integrationthread_count
(default1
) - The number of threads to use. A value of 1 keeps the program single threaded.
The array returned contains the roc scores.
Building
First run:
git clone https://github.com/brightlego/fastroc.git
cd fastroc
Then run:
Linux:
To build and install with you default Python3 installation, run
bash build.sh
Other
To build and install with another Python3 installation or on MacOS/Windows, run
<python-installation> -m build
<python-installation> -m pip install "$(ls dist/*.whl | sort -V | tail -n 1)" --force-reinstall
Notes for Windows:
This code is not tested on Windows and is unlikely to be able to use multithreading.
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
File details
Details for the file fastroc-1.1.3.tar.gz
.
File metadata
- Download URL: fastroc-1.1.3.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6c1b659b7dac75e52a19aecd4701d8fedc605a06b05425f65468daad4de5267 |
|
MD5 | d1df6e43a95c2d167607761198f8569a |
|
BLAKE2b-256 | 8561b884bec7c7d3490ef72cf071aa50977765c50ebdf80b92ea360cf499f5af |