Skip to main content

Overview

Fomo is a Fairness Oriented Multiobjective Optimization toolbox for training regression and classification models. Fomo focuses on optimizing the trade-offs between various metrics in ML fairness that are often in direct conflict. The goal is to assist decision makers in weighing multiple criteria by generating good solution sets, rather than singular models.

Cite

If you use Fomo please cite the following:

  • W.G. La Cava (2023). Optimizing fairness tradeoffs in machine learning with multiobjective meta-models. GECCO '23. arXiv:2304.12190

Introduction

Fomo is designed to be incredibly general. It works with any ML model that has a scikit-learn interface (i.e. fit() and predict() methods) and takes sample weights as part of its loss function. Specifically, the fit() method should optionally take an argument, sample_weight, that provides a weight to each observation in X,y. That covers nearly all estimators in sklearn, including linear models (linear and logistic regression, lasso), SVMs, neural nets, decision trees, and ensemble methods like random forests, gradient boosting, and XGBoost.

In addition, Fomo works with many different metrics of fairness and accuracy. It currently supports:

  • Subgroup Fairness (False Positive, False Negative, and Demographic Parity)
  • Differential Fairness (Demographic Parity and Calibration)
  • Multicalibration
  • Proportional Multicalibration

In addition, users can specify any callable function they would like to be optimized, as long as it matches the call signature of these functions. Users can specify the combination of performance metrics and fairness metrics that best suit the task they are studying. You can specify any number and combinatoin of these metrics.

Finally, Fomo works with many different optimization methods available from pymoo, including NSGA-II, NSGA-III, MOEAD, and others.

Quick Start

Installation

pip install pyfomo

Dependencies

The requirements for fomo are listed in environment.yml.

Note on pymoo If you are working in linux and get a warning about pymoo, is recommended that you manually install it from the github repo rather than pip:

git clone https://github.com/anyoptimization/pymoo
cd pymoo
make compile
pip install .

Development

To install a development version, do the following:

git clone https://github.com/cavalab/fomo
cd fomo
pip install . 

Basic Usage

Here is an example of training a fair classifier on the adult income prediction dataset.

from fomo import FomoClassifier
from pmlb import pmlb
dataset = pmlb.fetch_data('adult')
X = dataset.drop('target',axis=1)
y = dataset['target']
groups = ['race','sex']
est = FomoClassifier()
est.fit(X,y, protected_features=groups)

License

See LICENSE.

Contact

  • William La Cava: william dot lacava at childrens dot harvard dot edu

Metadata

Release files for pyfomo 0.0.17

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

Source distribution (sdist)

Source distribution for pyfomo 0.0.17
File Size Uploaded
pyfomo-0.0.17.tar.gz 20.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfomo 0.0.17
File Interpreter ABI Platform
pyfomo-0.0.17-py3-none-any.whl Python 3 none any Details

Total release size: 47.4 kB

Release files / pyfomo-0.0.17.tar.gz

Download URL pyfomo-0.0.17.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
38f40352aa5fa2ae5c447145556d9cb557205e5ce56f7a1980f9893bd59f7b41
BLAKE2b-256 checksum
How to use checksums
90afa87092c050a596e2f4642314cee9bd6b629bbfb15539480e26fc84b0c033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / pyfomo-0.0.17-py3-none-any.whl

Download URL pyfomo-0.0.17-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2354464386ecfb385fa9752e64a801acaa82ac198a2f4acdbd05a8f45648425
BLAKE2b-256 checksum
How to use checksums
33bbc0cd7a7e5d83847f7ddff0cd528ca6995831ede2c9d364c563bd97db3469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.0.17 This release

2 release files

0.0.15

1 release file

0.0.14

1 release file

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

1 release file

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