fairlearn.reductions.LossMoment#
- class fairlearn.reductions.LossMoment(loss)[source]#
Moment that can be expressed as weighted loss.
Added in version 0.3.0.
- gamma(predictor)[source]#
Calculate the degree to which constraints are currently violated by the predictor.
- project_lambda(lambda_vec)[source]#
Return the projected lambda values.
- Parameters:
lambda_vec (
Series) – The vector of Lagrange multipliers, indexed byindex.- Return type:
- Returns:
Lagrange multipliers that give the same or a higher Lagrangian value than lambda_vec for every predictor and may have a smaller L1 norm. They are used by the
ExponentiatedGradientalgorithm when evaluating the Lagrangian.
- signed_weights(lambda_vec)[source]#
Return the signed weights.
- Parameters:
lambda_vec (
Series) – The vector of Lagrange multipliers, indexed byindex.- Return type:
- Returns:
One weight per sample. For classification, reductions add the objective and constraint weights, use the sign of the sum to choose a binary label for the cost-sensitive learning problem, and use its absolute value as the sample weight for the underlying estimator. For regression, the original target values are kept and the weights are used to reweight samples.
GridSearchomits separate objective weights when the objective is already in the span of the constraints.
- property index: MultiIndex | Index#
Return a pandas (multi-)index listing the constraints.