lale.lib.aif360.redacting module¶
- class lale.lib.aif360.redacting.Redacting(*, favorable_labels, protected_attributes, unfavorable_labels)¶
Bases:
PlannedIndividualOp
Redacting preprocessor for fairness mitigation.
This documentation is auto-generated from JSON schemas.
This sets all the protected attributes to constants, using the most frequent value in the column. This operator is used internally by various lale.lib.aif360 metrics and mitigators, so you often do not need to use it directly yourself.
- Parameters
favorable_labels (Any, not for optimizer) – Ignored.
protected_attributes (array, >=1 items, not for optimizer) –
Features for which fairness is desired.
items : dict
feature : union type
Column name or column index.
string
or integer
reference_group : array, >=1 items
Values or ranges that indicate being a member of the privileged group.
items : union type
string
Literal value.
or float
Numerical value.
or array, >=2 items, <=2 items of items : float
Numeric range [a,b] from a to b inclusive.
monitored_group : union type, default None
Values or ranges that indicate being a member of the unprivileged group.
None
If monitored_group is not explicitly specified, consider any values not captured by reference_group as monitored.
or array, >=1 items
items : union type
string
Literal value.
or float
Numerical value.
or array, >=2 items, <=2 items of items : float
Numeric range [a,b] from a to b inclusive.
unfavorable_labels (Any, not for optimizer) – Ignored.
- fit(X, y=None, **fit_params)¶
Train the operator.
Note: The fit method is not available until this operator is trainable.
Once this method is available, it will have the following signature:
- Parameters
X (array) –
Features; the outer array is over samples.
items : array
items : union type
float
or string
y (any type, optional) – Target values; the array is over samples.
- transform(X, y=None)¶
Transform the data.
Note: The transform method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array) –
Features; the outer array is over samples.
items : array
items : union type
float
or string
- Returns
result – Output data schema for reweighted features.
items : array
items : union type
float
or string
- Return type
array