fairlearn.reductions.ClassificationMoment#

class fairlearn.reductions.ClassificationMoment[source]#

Moment that can be expressed as weighted classification error.

bound()[source]#

Return vector of fairness bound constraint the length of gamma.

Return type:

Series

default_objective()[source]#

Return the default objective for the moment.

Return type:

Moment

gamma(predictor)[source]#

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

Return type:

Series

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

Load a set of data for use by this object.

Return type:

None

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.

Return type:

Series

signed_weights(lambda_vec)[source]#

Return the signed weights.

Return type:

Series

property index: MultiIndex | Index#

Return a pandas (multi-)index listing the constraints.

property total_samples: int#

Return the number of samples in the data.