Skip to main content

A Python package for computing additional classification metrics for machine learning or AI models. These metrics include and also known as AUC, NRI, and IDI

Project description

AUC_NRI_IDI_python_functions

DOI

Custom python functions to help you further analyse machine learning models and diagnostic test.

Will help you make plots and compute evaluation metrics as seen in Nature Article, Leong et al. 2021

From Leong et. al. 2021

Metrics to compute and plot:

  • AUC = Area Under the Curve
  • NRI = Net Reclassification Index
  • IDI = Integrated Discrimination Improvement
  • Functions to compute bootstrap p-values for AUC and NRI differences

Run "example.ipynb" Jupyter notebook to see and use functions

Installation

pip install -r requirements.txt
pip install .

Running tests

pytest -q

Formulas

AUC [AUC = \int_0^1 TPR(FPR), dFPR ]

NRI [NRI = (P_{\text{up}|\text{event}} - P_{\text{down}|\text{event}}) + (P_{\text{down}|\text{non-event}} - P_{\text{up}|\text{non-event}})]

IDI [IDI = (\bar{p}{\text{new},1} - \bar{p}{\text{ref},1}) - (\bar{p}{\text{new},0} - \bar{p}{\text{ref},0})]

Usage

Import the package and call any metric helpers. See the example notebook for a detailed walkthrough.

Code and concepts further explained in the following post: "Area Under the Curve and Beyond" or "On Medium/Towards Data Science"


contact Lambert Leong

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

more_metrics-0.11.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

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

more_metrics-0.11.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file more_metrics-0.11.0.tar.gz.

File metadata

  • Download URL: more_metrics-0.11.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for more_metrics-0.11.0.tar.gz
Algorithm Hash digest
SHA256 733ac626ec841b97447bf18a21483c0b026e43fe5503e51b0a8397bfe6444740
MD5 39c8d61e3e3e2d40196ced81989fcd7d
BLAKE2b-256 71431d20e15984fe64713ae31132876d353b098d637087ba8421eccc37faac4a

See more details on using hashes here.

File details

Details for the file more_metrics-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: more_metrics-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for more_metrics-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3f156c0cd12e4e83012a3fdddc0d5aa72b68728bc6cd05ccf566068b13c0592
MD5 5d4a556475bd1f4e2f411e4dc2f2f334
BLAKE2b-256 65f71d4aa4feef2708f0c4c34e6f4198cf0a8b52e443e1076373a4da18ac552a

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