class_docstr: Transform between iterable of iterables and a multilabel format.
  
  Although a list of sets or tuples is a very intuitive format for multilabel
  data, it is unwieldy to process. This transformer converts between this
  intuitive format and the supported multilabel format: a (samples x classes)
  binary matrix indicating the presence of a class label.
  
  Parameters
  ----------
  classes : array-like of shape (n_classes,), default=None
      Indicates an ordering for the class labels.
      All entries should be unique (cannot contain duplicate classes).
  
  sparse_output : bool, default=False
      Set to True if output binary array is desired in CSR sparse format.
  
  Attributes
  ----------
  classes_ : ndarray of shape (n_classes,)
      A copy of the `classes` parameter when provided.
      Otherwise it corresponds to the sorted set of classes found
      when fitting.
  
  See Also
  --------
  OneHotEncoder : Encode categorical features using a one-hot aka one-of-K
      scheme.
  
  Examples
  --------
  >>> from sklearn.preprocessing import MultiLabelBinarizer
  >>> mlb = MultiLabelBinarizer()
  >>> mlb.fit_transform([(1, 2), (3,)])
  array([[1, 1, 0],
         [0, 0, 1]])
  >>> mlb.classes_
  array([1, 2, 3])
  
  >>> mlb.fit_transform([{'sci-fi', 'thriller'}, {'comedy'}])
  array([[0, 1, 1],
         [1, 0, 0]])
  >>> list(mlb.classes_)
  ['comedy', 'sci-fi', 'thriller']
  
  A common mistake is to pass in a list, which leads to the following issue:
  
  >>> mlb = MultiLabelBinarizer()
  >>> mlb.fit(['sci-fi', 'thriller', 'comedy'])
  MultiLabelBinarizer()
  >>> mlb.classes_
  array(['-', 'c', 'd', 'e', 'f', 'h', 'i', 'l', 'm', 'o', 'r', 's', 't',
      'y'], dtype=object)
  
  To correct this, the list of labels should be passed in as:
  
  >>> mlb = MultiLabelBinarizer()
  >>> mlb.fit([['sci-fi', 'thriller', 'comedy']])
  MultiLabelBinarizer()
  >>> mlb.classes_
  array(['comedy', 'sci-fi', 'thriller'], dtype=object)
class_docstr_tok: ["Transform","between","iterable","of","iterables","and","a","multilabel","format",".","Although","a","list","of","sets","or","tuples","is","a","very","intuitive","format","for","multilabel","data",",","it","is","unwieldy","to","process",".","This","transformer","converts","between","this","intuitive","format","and","the","supported","multilabel","format",":","a","(","samples","x","classes",")","binary","matrix","indicating","the","presence","of","a","class","label",".","Parameters","--","--","--","--","--","classes",":","array-like","of","shape","(","n_classes",",",")",",","default=None","Indicates","an","ordering","for","the","class","labels",".","All","entries","should","be","unique","(","can","not","contain","duplicate","classes",")",".","sparse_output",":","bool",",","default=False","Set","to","True","if","output","binary","array","is","desired","in","CSR","sparse","format",".","Attributes","--","--","--","--","--","classes_",":","ndarray","of","shape","(","n_classes",",",")","A","copy","of","the","`","classes","`","parameter","when","provided",".","Otherwise","it","corresponds","to","the","sorted","set","of","classes","found","when","fitting",".","See","Also","--","--","--","--","OneHotEncoder",":","Encode","categorical","features","using","a","one-hot","aka","one-of-K","scheme",".","Examples","--","--","--","--",">",">",">","from","sklearn.preprocessing","import","MultiLabelBinarizer",">",">",">","mlb","=","MultiLabelBinarizer","(",")",">",">",">","mlb.fit_transform","(","[","(","1",",","2",")",",","(","3",",",")","]",")","array","(","[","[","1",",","1",",","0","]",",","[","0",",","0",",","1","]","]",")",">",">",">","mlb.classes_","array","(","[","1",",","2",",","3","]",")",">",">",">","mlb.fit_transform","(","[","{","'sci-fi","'",",","'thriller","'","}",",","{","'comedy","'","}","]",")","array","(","[","[","0",",","1",",","1","]",",","[","1",",","0",",","0","]","]",")",">",">",">","list","(","mlb.classes_",")","[","'comedy","'",",","'sci-fi","'",",","'thriller","'","]","A","common","mistake","is","to","pass","in","a","list",",","which","leads","to","the","following","issue",":",">",">",">","mlb","=","MultiLabelBinarizer","(",")",">",">",">","mlb.fit","(","[","'sci-fi","'",",","'thriller","'",",","'comedy","'","]",")","MultiLabelBinarizer","(",")",">",">",">","mlb.classes_","array","(","[","'-","'",",","'","c","'",",","'d","'",",","'","e","'",",","'","f","'",",","'","h","'",",","'","i","'",",","'","l","'",",","'m","'",",","'","o","'",",","'","r","'",",","'s","'",",","'t","'",",","'","y","'","]",",","dtype=object",")","To","correct","this",",","the","list","of","labels","should","be","passed","in","as",":",">",">",">","mlb","=","MultiLabelBinarizer","(",")",">",">",">","mlb.fit","(","[","[","'sci-fi","'",",","'thriller","'",",","'comedy","'","]","]",")","MultiLabelBinarizer","(",")",">",">",">","mlb.classes_","array","(","[","'comedy","'",",","'sci-fi","'",",","'thriller","'","]",",","dtype=object",")"]
docstr: Fit the label sets binarizer and transform the given label sets.
  
  Parameters
  ----------
  y : iterable of iterables
      A set of labels (any orderable and hashable object) for each
      sample. If the `classes` parameter is set, `y` will not be
      iterated.
  
  Returns
  -------
  y_indicator : {ndarray, sparse matrix} of shape (n_samples, n_classes)
      A matrix such that `y_indicator[i, j] = 1` iff `classes_[j]`
      is in `y[i]`, and 0 otherwise. Sparse matrix will be of CSR
      format.
docstr_tok: ["Fit","the","label","sets","binarizer","and","transform","the","given","label","sets",".","Parameters","--","--","--","--","--","y",":","iterable","of","iterables","A","set","of","labels","(","any","orderable","and","hashable","object",")","for","each","sample",".","If","the","`","classes","`","parameter","is","set",",","`","y","`","will","not","be","iterated",".","Returns","--","--","--","-","y_indicator",":","{","ndarray",",","sparse","matrix","}","of","shape","(","n_samples",",","n_classes",")","A","matrix","such","that","`","y_indicator","[","i",",","j","]","=","1","`","iff","`","classes_","[","j","]","`","is","in","`","y","[","i","]","`",",","and","0","otherwise",".","Sparse","matrix","will","be","of","CSR","format","."]
code: def fit_transform(self, y):
      """Fit the label sets binarizer and transform the given label sets.
  
      Parameters
      ----------
      y : iterable of iterables
          A set of labels (any orderable and hashable object) for each
          sample. If the `classes` parameter is set, `y` will not be
          iterated.
  
      Returns
      -------
      y_indicator : {ndarray, sparse matrix} of shape (n_samples, n_classes)
          A matrix such that `y_indicator[i, j] = 1` iff `classes_[j]`
          is in `y[i]`, and 0 otherwise. Sparse matrix will be of CSR
          format.
      """
      if self.classes is not None:
          return self.fit(y).transform(y)
  
      self._cached_dict = None
  
      # Automatically increment on new class
      class_mapping = defaultdict(int)
      class_mapping.default_factory = class_mapping.__len__
      yt = self._transform(y, class_mapping)
  
      # sort classes and reorder columns
      tmp = sorted(class_mapping, key=class_mapping.get)
  
      # (make safe for tuples)
      dtype = int if all(isinstance(c, int) for c in tmp) else object
      class_mapping = np.empty(len(tmp), dtype=dtype)
      class_mapping[:] = tmp
      self.classes_, inverse = np.unique(
          class_mapping, return_inverse=True
      )
      # ensure yt.indices keeps its current dtype
      yt.indices = np.array(
          inverse[yt.indices], dtype=yt.indices.dtype, copy=False
      )
  
      if not self.sparse_output:
          yt = yt.toarray()
  
      return yt
  
imports: import array
  import itertools
  import warnings
  from collections import defaultdict
  from numbers import Integral
  import numpy
  import scipy.sparse
  from ..base import BaseEstimator, TransformerMixin, _fit_context
  from ..utils import column_or_1d
  from ..utils._encode import _encode, _unique
  from ..utils._param_validation import Interval, validate_params
  from ..utils.multiclass import type_of_target, unique_labels
  from ..utils.sparsefuncs import min_max_axis
  from ..utils.validation import _num_samples, check_array, check_is_fitted
label_desc: Use image node_id 3 for calling the MultiLabelBinarizer obj's underlying member method code with example usage: obj.fit_transform(y) and returns: yt, self