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: Only :meth:`fit_transform` is allowed for this algorithm.
docstr_tok: ["Only",":","meth",":","`","fit_transform","`","is","allowed","for","this","algorithm","."]
code: def fit(self, X, y, sample_weight=None):
      """Only :meth:`fit_transform` is allowed for this algorithm."""
      self.fit_transform(X, y, sample_weight=sample_weight)
      return self
  
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 2 for calling the Reweighing obj's underlying member method code with example usage: obj.fit(X, y, sample_weight) and returns: self