Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.34 KB

File metadata and controls

54 lines (41 loc) · 1.34 KB

Constraint

Supported linear constraints in ReHLine are listed in the table below.

Usage

# list of
# name (str): name of the custom linear constraints
# loss_kwargs: more keys and values for constraint parameters
constraint = [{'name': <constraint_name>, <**constraint_kwargs>}, ...]
constraint
args
Example
nonnegative
name: 'nonnegative' or '>=0'
constraint=[{'name': '>=0'}]
fair
name: 'fair' or 'fairness'
sen_idx: a list contains column indices for sensitive attributes
tol_sen: 1d array [p] of tolerance for fairness
constraint=[{'name': 'fair', 'sen_idx': sen_idx, 'tol_sen': tol_sen}]
monotonic
name: 'monotonic' or 'monotonicity'
decreasing (bool): False (default)
constraint=[{'name': 'monotonic', 'decreasing': True}]
custom
name: 'custom'
A: 2d array [K x d] for linear constraint coefficients
b: 1d array [K] of constraint intercepts
constraint=[{'name': 'custom', 'A': A, 'b': b}]

Related Examples

.. nblinkgallery::
   :caption: Constraints
   :name: rst-link-gallery

   ../examples/FairSVM.ipynb
   ../examples/NMF.ipynb