class_docstr: Base class for models which incorporate inFairness algorithms.
class_docstr_tok: ["Base","class","for","models","which","incorporate","inFairness","algorithms","."]
docstr: Initialize and fit the model.
  
  If the module was already initialized, by calling fit, the module will
  be re-initialized (unless ``warm_start`` is True).
  
  Args:
      X (array-like): Training samples.
      y (array-like): Training labels. If X is a Dataset that contains
          the target, y may be set to ``None``. Note: if ``regression`` is
          'auto' in this case, classification will be assumed. If y is
          already binary/ordinal encoded (i.e., the unique labels consist
          of the integers from [0, C)) it is passed as-is, however, if y
          contains nominal values, it is encoded with
          :class:`sklearn.preprocessing.LabelBinarizer` and cast to
          'float32' for compatibility with torch loss functions.
          Regression targets are also left unmodified.
      **fit_params: Additional parameters passed to the `forward`` method
          of the module and to the ``self.train_split`` call.
  
  Returns:
      self
docstr_tok: ["Initialize","and","fit","the","model",".","If","the","module","was","already","initialized",",","by","calling","fit",",","the","module","will","be","re-initialized","(","unless","``","warm_start","``","is","True",")",".","Args",":","X","(","array-like",")",":","Training","samples",".","y","(","array-like",")",":","Training","labels",".","If","X","is","a","Dataset","that","contains","the","target",",","y","may","be","set","to","``","None","``",".","Note",":","if","``","regression","``","is","'auto","'","in","this","case",",","classification","will","be","assumed",".","If","y","is","already","binary\/ordinal","encoded","(","i.e.",",","the","unique","labels","consist","of","the","integers","from","[","0",",","C",")",")","it","is","passed","as-is",",","however",",","if","y","contains","nominal","values",",","it","is","encoded","with",":","class",":","`","sklearn.preprocessing.LabelBinarizer","`","and","cast","to","'float32","'","for","compatibility","with","torch","loss","functions",".","Regression","targets","are","also","left","unmodified",".","*","*","fit_params",":","Additional","parameters","passed","to","the","`","forward","``","method","of","the","module","and","to","the","``","self.train_split","``","call",".","Returns",":","self"]
code: def fit(self, X, y, **fit_params):
      """Initialize and fit the model.
  
      If the module was already initialized, by calling fit, the module will
      be re-initialized (unless ``warm_start`` is True).
  
      Args:
          X (array-like): Training samples.
          y (array-like): Training labels. If X is a Dataset that contains
              the target, y may be set to ``None``. Note: if ``regression`` is
              'auto' in this case, classification will be assumed. If y is
              already binary/ordinal encoded (i.e., the unique labels consist
              of the integers from [0, C)) it is passed as-is, however, if y
              contains nominal values, it is encoded with
              :class:`sklearn.preprocessing.LabelBinarizer` and cast to
              'float32' for compatibility with torch loss functions.
              Regression targets are also left unmodified.
          **fit_params: Additional parameters passed to the `forward`` method
              of the module and to the ``self.train_split`` call.
  
      Returns:
          self
      """
      self.regression_ = self.regression
      if y is not None and self.regression_ is not True:
          ttype = type_of_target(y)
          if ttype in ("binary", "multiclass", "multilabel-indicator"):
              lb = LabelBinarizer().fit(y)
              self.classes_ = lb.classes_
              if self.classes_.tolist() != list(
                  range(len(self.classes_))
              ):
                  y = lb.transform(y).astype("float32")
          elif "continuous" in ttype and self.regression_ == "auto":
              self.regression_ = True
          else:
              raise ValueError(
                  f"Detected {ttype} type y with regression="
                  f"{self.regression}. This combination is not supported."
              )
      if self.regression_ == "auto":
          self.regression_ = False
      return super().fit(X, y, **fit_params)
  
imports: from inFairness import fairalgo
  from sklearn.preprocessing import LabelBinarizer
  from sklearn.utils.multiclass import type_of_target
  from sklearn.exceptions import NotFittedError
  from skorch import NeuralNet
  from skorch.dataset import unpack_data, Dataset
  from skorch.utils import is_pandas_ndframe
label_desc: Use image node_id 7 for calling the InFairnessNet obj's underlying member method code with example usage: obj.fit(X, y) and returns: super