Skip to main content

testAUC is a library of tools to evaluate the true performance of ML/AI models

Project description

testAUC

Quick start

pip install testAUC

To evaluate the drift between the Validation set to the Test set use:

from testAUC import roc_drift
tpr_drift, fpr_drift, drift, thresholds_val, mean_drift = roc_drift(y_true_val, y_score_val, y_true_tst, y_score_tst)

Motivation

The ROC (Receiver operating characteristic) curve is generally used for evaluation of ML/AI model performance in classification tasks. There are a number of pitfalls of using the ROC curve, some of which are outlined in example below

Example 0: example0.py

Demonstrates how two very different predictions can result in the exact same ROC curve.

Example0

Example 1: example1.py

Demonstrates the shifting of the operation point, despite the favourable AUC. We show predictions of a (simulated) model on the Validation set and the Test set. The ROC AUC "happens" to be identical. However, if you choose a threshold on the Validation set, aiming for a Sensitivity/Specificity operation point, you would get completely different operation point on the Test set

Example1

Example 2: example2.py

Demonstrates a measure of robustness to noise. We show two models, Initially it seems that Model 1 is far better, offering ROC AUC above 91% However, evaluating the robustness to uniform noise shows Model 2 is more robust

Example2

Example 3: example3.py

Demonstrates a measure of DRIFT between the validation set and the test set We show two models, both of them "happen" to have the exact same AUC on the validation and test sets. However, evaluating the DRIFT of the Sensitivity/Specificity operation point reveals that Model 1 is better (although in this extreme case, both models exhibit significant drifts)

Note that at some operation point, Model 2 actually exceeds a drift of -50% from the Sensitivity expected at Validation time, compared to the Sensitivity received at test time - without affecting the total AUC.

Example3

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

testauc-0.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

testauc-0.0.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file testauc-0.0.3.tar.gz.

File metadata

  • Download URL: testauc-0.0.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for testauc-0.0.3.tar.gz
Algorithm Hash digest
SHA256 88b99d27f8acb54072dff58d7f6152dcccdc5f99f2f04e0257c6f9ceb30e1722
MD5 c95599690448492b345112866297f710
BLAKE2b-256 a83b37891765696ee6e4ceb7de834d9dfbe4894a1d34a1ca95f19a61192b5a78

See more details on using hashes here.

File details

Details for the file testauc-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: testauc-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for testauc-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 30bed65ced3608562a5c3e0975d262df0762296b83fc25543a886aa682404489
MD5 4b3b117219a943717d0b07f1f83e9279
BLAKE2b-256 0339d557f61b4396141b665dfa5062dd14de0c737b661f09a1237d2ae5c6e3c1

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