Skip to main content

A package for calibration measurement and analysis

Project description

calzone: a python package for measuring calibration in probabilistic models

Docs

calzone is a comprehensive Python package for calculating and visualizing various metrics to assess the calibration of probabilistic models. To accurately assess the calibration of machine learning models, it is essential to have a comprehensive and reprensative dataset with sufficient coverage of the prediction space. The calibration metrics is not meaningful if the dataset is not representative of true intended population.

Features

  • Supports multiple calibration metrics including Spiegelhalter's Z-test, Expected Calibration Error (ECE), Maximum Calibration Error (MCE), Hosmer-Lemeshow test, Cox regression analysis, and Loess regression analysis
  • Provides tools for creating reliability diagrams and ROC curves
  • Offers both equal-space and equal-frequency binning options
  • Boostrapping for confidence intervals for each calibration metrics
  • Prevelance adjustment to account for prevalance change between enriched data and population data.
  • Multiclass extension by 1-vs-rest or top-class only

Installation

calzone package require installation of numpy, scipy, matplotlib and statsmodels.

You can install calzone using pip:

pip install -e "git+https://github.com/DIDSR/calzone.git#egg=calzone"

Alternatively, you can clone the repository and install it locally:

git clone https://github.com/DIDSR/calzone.git
cd calzone
pip install .

Usage

run python cal_metrics.py -h to see the help information and usage. To use the package in your Python code, please refer to the examples in the documentation pages.

A GUI is available by running python GUI_cal_metrics.py. Support for the GUI is experiment and requires additional dependencies (i.e., nicegui).

Documentation

For a detailed manual and API reference, please visit our documentation page.

Support

If you encounter any issues or have questions about the package, please open an issue request or contact the authors:

Disclaimer

This software and documentation (the "Software") were developed at the Food and Drug Administration (FDA) by employees of the Federal Government in the course of their official duties. Pursuant to Title 17, Section 105 of the United States Code, this work is not subject to copyright protection and is in the public domain. Permission is hereby granted, free of charge, to any person obtaining a copy of the Software, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, or sell copies of the Software or derivatives, and to permit persons to whom the Software is furnished to do so. FDA assumes no responsibility whatsoever for use by other parties of the Software, its source code, documentation or compiled executables, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic. Further, use of this code in no way implies endorsement by the FDA or confers any advantage in regulatory decisions. Although this software can be redistributed and/or modified freely, we ask that any derivative works bear some notice that they are derived from it, and any modified versions bear some notice that they have been modified.

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

calzone_tool-0.1.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

calzone_tool-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file calzone_tool-0.1.0.tar.gz.

File metadata

  • Download URL: calzone_tool-0.1.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for calzone_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a476e13f80f5cbcd2bf7c33265244584885f697f9a86405ff28a0153effe37ec
MD5 583c41a36847ed3179ffffca5030a3c4
BLAKE2b-256 08e47e5216ca6e53d986bbe3172a6b404d3974d568f6254b3da06277dd7dd9c1

See more details on using hashes here.

File details

Details for the file calzone_tool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: calzone_tool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for calzone_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a302de3ae91f84537dafdb485997e2aa651e414d69fd4399505ab5598e1e865b
MD5 76879e9828b0f825333d7dafe858d078
BLAKE2b-256 d0843ba8a4dd3d37713d2c5fceec57d48295f0550b8ba447a7455df52de93d59

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