fairlearn.reductions.Moment#

class fairlearn.reductions.Moment[source]#

Generic moment.

Our implementations of the reductions approach to fairness [1] make use of Moment objects to describe both the optimization objective and the fairness constraints imposed on the solution. This is an abstract class for all such objects.

Read more in the User Guide.

bound()[source]#

Return vector of fairness bound constraint the length of gamma.

gamma(predictor)[source]#

Calculate the degree to which constraints are currently violated by the predictor.

load_data(X, y, *, sensitive_features=None)[source]#

Load a set of data for use by this object.

Parameters:
Xarray

The feature array

ypandas.Series

The label vector

sensitive_featurespandas.Series

The sensitive feature vector (default None)

project_lambda(lambda_vec)[source]#

Return the projected lambda values.

signed_weights(lambda_vec)[source]#

Return the signed weights.

property total_samples#

Return the number of samples in the data.