class_docstr: Implementation of error rate parity as a moment.
  
  A classifier :math:`h(X)` satisfies error rate parity if
  
  .. math::
    P[h(X) \ne Y | A = a] = P[h(X) \ne Y] \; \forall a
  
  This implementation of :class:`UtilityParity` defines
  a single event, `all`. Consequently, the `prob_event`
  :class:`pandas:pandas.Series` will only have a single
  entry, which will be equal to 1.
  
  The `index` property will have twice as many entries (corresponding to the Lagrange multipliers
  for positive and negative constraints) as there are unique values for the sensitive feature.
  
  The :meth:`UtilityParity.signed_weights` method will compute the costs according to Example 3
  of :footcite:t:`agarwal2018reductions`.
  However, in this scenario, g = abs(h(x)-y), rather than g = h(x)
  
  This :class:`~Moment` also supports control features, which can be used to
  stratify the data, with the constraint applied within
  each stratum, but not between strata.
  
  Read more in the :ref:`User Guide <error_rate_parity>`.
class_docstr_tok: ["Implementation","of","error","rate","parity","as","a","moment",".","A","classifier",":","math",":","`","h","(","X",")","`","satisfies","error","rate","parity","if","..","math",":",":","P","[","h","(","X",")","\\ne","Y","|","A","=","a","]","=","P","[","h","(","X",")","\\ne","Y","]","\\",";","\\forall","a","This","implementation","of",":","class",":","`","UtilityParity","`","defines","a","single","event",",","`","all","`",".","Consequently",",","the","`","prob_event","`",":","class",":","`","pandas",":","pandas.Series","`","will","only","have","a","single","entry",",","which","will","be","equal","to","1",".","The","`","index","`","property","will","have","twice","as","many","entries","(","corresponding","to","the","Lagrange","multipliers","for","positive","and","negative","constraints",")","as","there","are","unique","values","for","the","sensitive","feature",".","The",":","meth",":","`","UtilityParity.signed_weights","`","method","will","compute","the","costs","according","to","Example","3","of",":","footcite",":","t",":","`","agarwal2018reductions","`",".","However",",","in","this","scenario",",","g","=","abs","(","h","(","x",")","-y",")",",","rather","than","g","=","h","(","x",")","This",":","class",":","`","~Moment","`","also","supports","control","features",",","which","can","be","used","to","stratify","the","data",",","with","the","constraint","applied","within","each","stratum",",","but","not","between","strata",".","Read","more","in","the",":","ref",":","`","User","Guide","<","error_rate_parity",">","`","."]
docstr: Load the specified data into the object.
docstr_tok: ["Load","the","specified","data","into","the","object","."]
code: def load_data(
      self, X, y, *, sensitive_features, control_features=None
  ):
      """Load the specified data into the object."""
      _, y_train, sf_train, cf_train = _validate_and_reformat_input(
          X,
          y,
          enforce_binary_labels=True,
          sensitive_features=sensitive_features,
          control_features=control_features,
      )
      utilities = np.vstack([y_train, 1 - y_train]).T
      base_event = pd.Series(data=_ALL, index=y_train.index)
      event = _merge_event_and_control_columns(base_event, cf_train)
      super().load_data(
          X,
          y_train,
          event=event,
          utilities=utilities,
          sensitive_features=sf_train,
      )
  
imports: import numpy
  import pandas
  from fairlearn.utils._input_validation import _MESSAGE_RATIO_NOT_IN_RANGE, _validate_and_reformat_input
  from .error_rate import ErrorRate
  from .moment import _ALL, _EVENT, _GROUP_ID, _LABEL, _SIGN, ClassificationMoment
label_desc: Use image node_id 1 for calling the ErrorRateParity obj's underlying member method code with example usage: obj.load_data(X, y) without return types