error_parity.cvxpy_utils

A set of helper functions for using cvxpy.

Functions

compute_fair_optimum(*, fairness_constraint, ...)

Computes the solution to finding the optimal fair (equal odds) classifier.

compute_halfspace_inequality(p1, p2)

Computes the halfspace inequality defined by the vector p1->p2, such that

compute_line(p1, p2)

Computes the slope and intercept of the line that passes through the two given points.

make_cvxpy_halfspace_inequality(p1, p2, ...)

Creates a single cvxpy inequality constraint that enforces the given point, cvxpy_point, to lie on the left of the vector p1->p2.

make_cvxpy_point_in_polygon_constraints(...)

Creates the set of cvxpy constraints that force the given cvxpy variable point to lie within the polygon defined by the given vertices.