fairlearn.reductions.ClassificationMoment#
- class fairlearn.reductions.ClassificationMoment[source]#
Moment that can be expressed as weighted classification error.
- Attributes
total_samples
Return the number of samples in the data.
Methods
bound
()Return vector of fairness bound constraint the length of gamma.
gamma
(predictor)Calculate the degree to which constraints are currently violated by the predictor.
load_data
(X, y, *[, sensitive_features])Load a set of data for use by this object.
project_lambda
(lambda_vec)Return the projected lambda values.
signed_weights
(lambda_vec)Return the signed weights.
- 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
X (array) – The feature array
y (
pandas.Series
) – The label vectorsensitive_features (
pandas.Series
) – The sensitive feature vector (default None)
- property total_samples#
Return the number of samples in the data.