Skip to main content

Model Facts

Create a Model Facts label to increase trust and improve the transparency of your model when communicating with end users.

This label provides a framework to interrogate models for biases and accuracy. It highlights the necessary information for comparing models in a simple and flexible format.

Last Updated: 18 March, 2025

Framework

Model Facts

Installation

It can be installed from PyPI using:

pip install modelfacts

Note: the template notebooks are only available in the source distribution.

You can also clone this repository and install required packages through:

git clone https://github.com/jhzsquared/model_facts.git
pip install -r requirements.txt

Usage

Model Facts is designed to be flexible, whether you have formatted results and just want to fill out a template, or want to generate your own statistics.

Additional background information and resources are discussed in our paper: https://doi.org/10.1093/jamia/ocae102, as well as our presentation at the 2025 INFORMS Analytics+ conference. The slide deck is shared as the file informs_modelfacts_presentation.pptx.

Template

  1. Download the model_facts_template.ipynb notebook.
  2. Create a csv file with the test data, the aligned demographic variables, predictions, baseline, and truth values.
  3. Run the first code cell
  4. Fill out the form
  5. Profit! :)

Note: the template currently only supports metrics from scikit-learn.metrics, binary classification, and regression models. For more complex modeling problems, please reference the other workflows.

DIY

The demo/model_facts_titanic.ipynb notebook provides a simple example of how you can use Model Facts labels on your own dataset with more flexibility through the modelfacts.ModelFacts class.

Extra DIY

Use the modelfacts.ModelFactsLabel class and pass in your own pre-calculated statistics.

model_facts_data = (admin_data, accuracy_data, demographic_data)
mf_label = mfw.ModelFactsLabel(model_facts_data)
table = mf_label(application, warning, source, show=True)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Make sure to update tests as appropriate.

Reach out if you are interested in joining the team for continued development of this project

Limitations

The automated calculation code currently only supports binary classification and regressions. Users can use their own calculations and the modelfacts.ModelFactsLabel to generate a label from their own statistics.

License

Model Facts is licensed under the MIT license.

Citation

This project was developed as a follow-up to the following paper. Please cite the following if you are using Model Facts labels:

Jessica Zhu, Michel Cukier, Joseph Richardson, Nutrition facts, drug facts, and model facts: putting AI ethics into practice in gun violence research, Journal of the American Medical Informatics Association, Volume 31, Issue 10, October 2024, Pages 2414–2421, https://doi.org/10.1093/jamia/ocae102

or

@article{10.1093/jamia/ocae102,
    author = {Zhu, Jessica and Cukier, Michel and Richardson, Joseph, Jr},
    title = {Nutrition facts, drug facts, and model facts: putting AI ethics into practice in gun violence research},
    journal = {Journal of the American Medical Informatics Association},
    volume = {31},
    number = {10},
    pages = {2414-2421},
    year = {2024},
    month = {05},
    issn = {1527-974X},
    doi = {10.1093/jamia/ocae102},
    url = {https://doi.org/10.1093/jamia/ocae102},
    eprint = {https://academic.oup.com/jamia/article-pdf/31/10/2414/59206288/ocae102.pdf},
}

Metadata

Release files for ModelFacts 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ModelFacts 0.0.4
File Size Uploaded Provenance Actions
modelfacts-0.0.4.tar.gz 243.4 kB With provenance Details for modelfacts-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ModelFacts 0.0.4
File Interpreter ABI Platform Actions
modelfacts-0.0.4-py3-none-any.whl Python 3 none any Details for modelfacts-0.0.4-py3-none-any.whl

Total release size: 255.0 kB

Release files / modelfacts-0.0.4.tar.gz

Download URL modelfacts-0.0.4.tar.gz
Size 243.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e86a17c94447cad5ed10a86d31afe7da3fd729d91fa7c4f3fe6418d9cef2e255
BLAKE2b-256 checksum
How to use checksums
0108090285af53e5e72074b90f1818b3633c4b6ad19f95b04e5ab1d117685a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / modelfacts-0.0.4-py3-none-any.whl

Download URL modelfacts-0.0.4-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6b4682d2c7fec302e83e5033d292604e1f28d905866d5d0d0bb1799529439a7
BLAKE2b-256 checksum
How to use checksums
f6e27737cb88ec4e58e5c1bed457304ac40174fe86fb46490065271194ecdd3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for ModelFacts 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for modelfacts-0.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page