Skip to main content

Fairness Indicators TensorBoard Plugin

Project description

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 tensorboard_plugin_fairness_indicators

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.

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

Built Distribution

File details

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

File metadata

  • Download URL: tensorboard_plugin_fairness_indicators-0.0.3.tar.gz
  • Upload date:
  • Size: 300.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5rc1

File hashes

Hashes for tensorboard_plugin_fairness_indicators-0.0.3.tar.gz
Algorithm Hash digest
SHA256 c36a8cc3c4fb517747bdbb1b43a281f04ecdcc708e334f74729e1686f6d66bc5
MD5 d4f707dd8881c2a5cbc2351e29287863
BLAKE2b-256 14d8cdc5060c98da8b850aff4064dd48412406f6d86485bc66b0b9f46cbd3056

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tensorboard_plugin_fairness_indicators-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 09c0bcecb99d8da54e886200591d817fb3f0e06992f5f1c00a1cc5f84b161205
MD5 5936c9094910e654fc163bf3b7508340
BLAKE2b-256 fe778debc3dd02a8915106acf39c1bd6acef9cb3640b1ecc874a257ade0237ec

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page