Skip to main content

Evaluating Models with the Fairness Indicators Dashboard [Beta]

Fairness Indicators

Fairness Indicators for TensorBoard enables easy computation of commonly-identified fairness metrics for binary and multiclass classifiers. With the plugin, you can visualize fairness evaluations for your runs and easily compare performance across groups.

In particular, Fairness Indicators for TensorBoard allows you to evaluate and visualize model performance, sliced across defined groups of users. Feel confident about your results with confidence intervals and evaluations at multiple thresholds.

Many existing tools for evaluating fairness concerns don’t work well on large scale datasets and models. At Google, it is important for us to have tools that can work on billion-user systems. Fairness Indicators will allow you to evaluate across any size of use case, in the TensorBoard environment or in Colab.

Requirements

To install Fairness Indicators for TensorBoard, run:

python3 -m virtualenv ~/tensorboard_demo
source ~/tensorboard_demo/bin/activate
pip install --upgrade pip
pip install fairness_indicators
pip install tensorboard-plugin-fairness-indicators

Nightly Packages

Tensorboard Plugin also hosts nightly packages at https://pypi-nightly.tensorflow.org on Google Cloud. To install the latest nightly package, please use the following command:

pip install --extra-index-url https://pypi-nightly.tensorflow.org/simple tensorboard-plugin-fairness-indicators

This will install the nightly packages for the major dependencies of Tensorboard Plugin such as TensorFlow Model Analysis (TFMA).

Demo Colab

Fairness_Indicators_TensorBoard_Plugin_Example_Colab.ipynb contains an end-to-end demo to train and evaluate a model and visualize fairness evaluation results in TensorBoard.

Usage

To use the Fairness Indicators with your own data and evaluations:

  1. Train a new model and evaluate using tensorflow_model_analysis.run_model_analysis or tensorflow_model_analysis.ExtractEvaluateAndWriteResult API in model_eval_lib. For code snippets on how to do this, see the Fairness Indicators colab here.

  2. Write a summary data file using demo.py, which will be read by TensorBoard to render the Fairness Indicators dashboard (See the TensorBoard tutorial for more information on summary data files).

    Flags to be used with the demo.py utility:

    • --logdir: Directory where TensorBoard will write the summary
    • --eval_result_output_dir: Directory containing evaluation results evaluated by TFMA
    python demo.py --logdir=<logdir> --eval_result_output_dir=<eval_result_dir>`
    

    Or you can also use tensorboard_plugin_fairness_indicators.summary_v2 API to write the summary file.

    writer = tf.summary.create_file_writer(<logdir>)
    with writer.as_default():
        summary_v2.FairnessIndicators(<eval_result_dir>, step=1)
    writer.close()
    
  3. Run TensorBoard

    Note: This will start a local instance. After the local instance is started, a link will be displayed to the terminal. Open the link in your browser to view the Fairness Indicators dashboard.

    • tensorboard --logdir=<logdir>
    • Select the new evaluation run using the drop-down on the left side of the dashboard to visualize results.

Compatible versions

The following table shows the package versions that are compatible with each other. This is determined by our testing framework, but other untested combinations may also work.

tensorboard-plugin tensorflow tensorflow-model-analysis
GitHub master nightly (2.x) 0.52.0
v0.52.0 2.21.0 0.52.0
v0.48.0 2.17.1 0.48.0
v0.47.0 2.16.2 0.47.1
v0.46.0 2.15.0 0.46.0
v0.44.0 2.12.0 0.44.0
v0.43.0 2.11.0 0.43.0
v0.42.0 2.10.0 0.42.0
v0.41.0 2.9.0 0.41.0
v0.40.0 2.9.0 0.40.0
v0.39.0 2.8.0 0.39.0
v0.38.0 2.8.0 0.38.0
v0.37.0 2.7.0 0.37.0
v0.36.0 2.7.0 0.36.0
v0.35.0 2.6.0 0.35.0
v0.34.0 2.6.0 0.34.0
v0.33.0 2.5.0 0.33.0
v0.30.0 2.4.0 0.30.0
v0.29.0 2.4.0 0.29.0
v0.28.0 2.4.0 0.28.0
v0.27.0 2.4.0 0.27.0
v0.26.0 2.3.0 0.26.0
v0.25.0 2.3.0 0.25.0
v0.24.0 2.3.0 0.24.0
v0.23.0 2.3.0 0.23.0

Release files for tensorboard-plugin-fairness-indicators 0.52.0

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

Source distribution (sdist)

Source distribution for tensorboard-plugin-fairness-indicators 0.52.0
File Size Uploaded
tensorboard_plugin_fairness_indicators-0.52.0.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tensorboard-plugin-fairness-indicators 0.52.0
File Interpreter ABI Platform
tensorboard_plugin_fairness_indicators-0.52.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.2 kB

Release files / tensorboard_plugin_fairness_indicators-0.52.0.tar.gz

Download URL tensorboard_plugin_fairness_indicators-0.52.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
70578f45a536ed51ecbdd7e3dc935bb3127b3cffadeca0274eb093c408087cad
BLAKE2b-256 checksum
How to use checksums
b769a8a181fdb5898cce72b20654e18fc2043ee9c4077b8e5dc7c3734136716e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / tensorboard_plugin_fairness_indicators-0.52.0-py3-none-any.whl

Download URL tensorboard_plugin_fairness_indicators-0.52.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d9de6d178576f6ea5adf094254153cbb4ef74cbe43e49db6ada1cf74b14fecb
BLAKE2b-256 checksum
How to use checksums
590485b12b628b3cb4f5683bceeba213f236dd740b7e57802d12a09566345b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.52.0 This release

2 release files

0.48.0

1 release file

0.47.0

1 release file

0.46.0

1 release file

0.44.0

1 release file

0.43.0

1 release file

0.42.0

1 release file

0.41.0

1 release file

0.40.0

1 release file

0.39.0

1 release file

0.38.0

1 release file

0.37.0

1 release file

0.36.0

1 release file

0.35.0

1 release file

0.34.0

1 release file

0.33.0

1 release file

0.30.0

1 release file

0.29.0

1 release file

0.28.0

1 release file

0.27.0

1 release file

0.26.0

1 release file

0.25.0

1 release file

0.24.0

1 release file

0.23.0

1 release file

0.0.6

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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