A fairness-aware machine learning library

themis-ml is an open source machine learning library that implements several fairness-aware methods that comply with the sklearn API.

Fairness-aware Machine Learning

themis-ml defines discrimination as the preference (bias) for or against a set of social groups that result in the unfair treatment of its members with respect to some outcome.

It defines fairness as the opposite of discrimination, and in the context of a machine learning algorithm, this is measured by the degree to which the algorithm’s predictions favor one social group over another in relation to an outcome that holds socioeconomic, political, or legal importance, e.g. the denial/approval of a loan application.

An algorithm is “fair” depending on how we define fairness, the outcome of interest, and the socially sensitive attributes that relate to potentially discriminatory circumstances. For example, if we consider fairness as statistical parity, a fair algorithm is one in which the proportion of approved loans among minorities is equal to the proportion of approved loans among white people.

However, there are many other ways to define and operationalize fairness, and the purpose of themis-ml is to attempt to provide an interface that gives users with access to formalized definitions of fairness and discrimination described in the the machine learning and statistics literature. Check out this paper for more details.


You can install themis-ml with conda or pip. Currently only Python 2.7 and 3.6 are supported.

# conda
conda install -c cosmicbboy themis-ml

If you install with pip, you’ll need to install scikit-learn, numpy, and pandas with either pip or conda. Version requirements:

  • numpy (>= 1.9.0)
  • scikit-learn (>= 0.19.1)
  • pandas (>= 0.22.0)
# pip
pip install themis-ml

Indices and tables