fatf.fairness.models.measures.disparate_impact_check

fatf.fairness.models.measures.disparate_impact_check(disparity_grid: numpy.ndarray) → bool[source]

Checks if any sub-population pair violates chosen disparate impact measure.

Parameters
disparity_gridnumpy.ndarray

A square, diagonally symmetric, boolean numpy array representing pair-wise disparity between subpopulations. See the return value of fatf.fairness.models.measures.demographic_parity as an example.

Returns
is_disparateboolean

True if there is a disparity between any pair of sub-populations, False otherwise.

Raises
IncorrectShapeError

The disparity grid matrix is not 2-dimensional or square.

TypeError

The disparity grid matrix is not of boolean type.

ValueError

The disparity grid matrix is a structured numpy array or is not diagonally symmetric.