Skip to main content

package for computing and visualizing the Absolute Between-ROC Area (ABROCA)

Project description

abroca

"abroca" is a python package to provide basic functionality for computing and visualizing the Absolute Between-ROC Area (ABROCA).

Install

The source code is currently hosted on github and Python package at PyPi

# PyPI
pip install abroca

Example

You can find the .ipynb file under example folder. It is a basic example which demonstrates the use of the abroca package to compute the ABROCA for a simple logistic regression classifier.

#Compute Abroca
slice = compute_abroca(df_test, pred_col = 'pred_proba' , label_col = 'returned',         
                       protected_attr_col = 'Gender', compare_type = 'binary',
                       n_grid = 10000, plot_slices = True)

The plot is automatically saved to a file and is displayed on-screen. The link to download the data is given in the comments in the example file. Parameters are self explainatory through the example file. Parameter details below.

  • df - dataframe containing colnames matching pred_col, label_col and protected_attr_col
  • pred_col - name of column containing predicted probabilities (string)
  • label_col - name of column containing true labels (should be 0,1 only) (string)
  • protected_attr_col - name of column containing protected attribute (string)
  • compare_type - comparison group being 'overall', 'multiple' (compare one majority with all classes) or 'binary'
  • majority_protected_attr_val(optional) - name of 'majority' group with respect to protected attribute (string)
  • n_grid (optional) - number of grid points to use in approximation (numeric) (default of 10000 is more than adequate for most cases)
  • plot_slices (optional) - if TRUE, ROC slice plots are generated and saved to file_name (boolean)
  • lb (optional) - Lower limit of integration (use -numpy.inf for -infinity) Default is 0
  • ub (optional) - Upper limit of integration (use -numpy.inf for -infinity) Default is 1
  • limit (optional) - An upper bound on the number of subintervals used in the adaptive algorithm.Default is 1000

Reference Paper: Josh Gardner, Christopher Brooks, and Ryan Baker (2019). Evaluating the Fairness of Predictive Student Models Through Slicing Analysis. Proceedings of the 9th International Conference on Learning Analytics and Knowledge (LAK19); March 4-8, 2019; Tempe, AZ, USA. https://doi.org/10.1145/3303772.3303791

Getting Help

If you encounter a clear bug, please file a minimal reproducible example on github, or contact the package maintainers directly (see the package documentation).

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

abroca-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

abroca-0.1.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file abroca-0.1.3.tar.gz.

File metadata

  • Download URL: abroca-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.7

File hashes

Hashes for abroca-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1139ddd0ad9cb56ad2af79e4e913a7bceddf6c4f7395a636439869bc9ce66215
MD5 dd7519668e6238ac43eb7d9009373ca5
BLAKE2b-256 2867f7c4fa3ec355bcd224c5cdbc8e992f47e7b47f822b9cf75a9bdba4409a63

See more details on using hashes here.

File details

Details for the file abroca-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: abroca-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.7

File hashes

Hashes for abroca-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 103e65348a37743760ecd3e9b7e98bdb610cb905bbd81544112355a6400e016b
MD5 d7560f31b9d70a0001fe7babf7861552
BLAKE2b-256 8a438f6e4235cb7bed4b7e8bc683d94d82091cd765b039f8e6ed9ccfc142fb5e

See more details on using hashes here.

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