class_docstr: Sample reweighing.
  
  Reweighing is a preprocessing technique that weights the examples in each
  (group, label) combination differently to ensure fairness before
  classification [#kamiran12]_.
  
  Note:
      This breaks the scikit-learn API by returning new sample weights from
      ``fit_transform()``. See :class:`ReweighingMeta` for a workaround.
  
  See also:
      :class:`ReweighingMeta`
  
  References:
      .. [#kamiran12] `F. Kamiran and T. Calders,  "Data Preprocessing
         Techniques for Classification without Discrimination," Knowledge and
         Information Systems, 2012.
         <https://link.springer.com/article/10.1007/s10115-011-0463-8>`_
  
  Attributes:
      prot_attr_ (str or list(str)): Protected attribute(s) used for
          reweighing.
      groups_ (array, shape (n_groups,)): A list of group labels known to the
          transformer.
      classes_ (array, shape (n_classes,)): A list of class labels known to
          the transformer.
      reweigh_factors_ (array, shape (n_groups, n_labels)): Reweighing factors
          for each combination of group and class labels used to debias
          samples. Existing sample weights are multiplied by the corresponding
          factor for that sample's group and class.
class_docstr_tok: ["Sample","reweighing",".","Reweighing","is","a","preprocessing","technique","that","weights","the","examples","in","each","(","group",",","label",")","combination","differently","to","ensure","fairness","before","classification","[","#","kamiran12","]","_",".","Note",":","This","breaks","the","scikit-learn","API","by","returning","new","sample","weights","from","``","fit_transform","(",")","``",".","See",":","class",":","`","ReweighingMeta","`","for","a","workaround",".","See","also",":",":","class",":","`","ReweighingMeta","`","References",":","..","[","#","kamiran12","]","`","F.","Kamiran","and","T.","Calders",",","``","Data","Preprocessing","Techniques","for","Classification","without","Discrimination",",","''","Knowledge","and","Information","Systems",",","2012",".","<","https",":","\/\/link.springer.com\/article\/10.1007\/s10115-011-0463-8",">","`","_","Attributes",":","prot_attr_","(","str","or","list","(","str",")",")",":","Protected","attribute","(","s",")","used","for","reweighing",".","groups_","(","array",",","shape","(","n_groups",",",")",")",":","A","list","of","group","labels","known","to","the","transformer",".","classes_","(","array",",","shape","(","n_classes",",",")",")",":","A","list","of","class","labels","known","to","the","transformer",".","reweigh_factors_","(","array",",","shape","(","n_groups",",","n_labels",")",")",":","Reweighing","factors","for","each","combination","of","group","and","class","labels","used","to","debias","samples",".","Existing","sample","weights","are","multiplied","by","the","corresponding","factor","for","that","sample","'s","group","and","class","."]
docstr: Args:
      prot_attr (single label or list-like, optional): Protected
          attribute(s) to use in the reweighing process. If more than one
          attribute, all combinations of values (intersections) are
          considered. Default is ``None`` meaning all protected attributes
          from the dataset are used.
docstr_tok: ["Args",":","prot_attr","(","single","label","or","list-like",",","optional",")",":","Protected","attribute","(","s",")","to","use","in","the","reweighing","process",".","If","more","than","one","attribute",",","all","combinations","of","values","(","intersections",")","are","considered",".","Default","is","``","None","``","meaning","all","protected","attributes","from","the","dataset","are","used","."]
code: def __init__(self, prot_attr=None):
      """
      Args:
          prot_attr (single label or list-like, optional): Protected
              attribute(s) to use in the reweighing process. If more than one
              attribute, all combinations of values (intersections) are
              considered. Default is ``None`` meaning all protected attributes
              from the dataset are used.
      """
      self.prot_attr = prot_attr
  
imports: import numpy
  from sklearn.base import BaseEstimator, MetaEstimatorMixin, clone
  from sklearn.utils.metaestimators import if_delegate_has_method
  from sklearn.utils.validation import has_fit_parameter
  from aif360.sklearn.utils import check_inputs, check_groups
label_desc: Use image node_id 1 to create a new Reweighing object from inherited base classes: BaseEstimator with example: obj = Reweighing(prot_attr)