class_docstr: Encode target labels with value between 0 and n_classes-1.
  
  This transformer should be used to encode target values, *i.e.* `y`, and
  not the input `X`.
  
  Read more in the :ref:`User Guide <preprocessing_targets>`.
  
  .. versionadded:: 0.12
  
  Attributes
  ----------
  classes_ : ndarray of shape (n_classes,)
      Holds the label for each class.
  
  See Also
  --------
  OrdinalEncoder : Encode categorical features using an ordinal encoding
      scheme.
  OneHotEncoder : Encode categorical features as a one-hot numeric array.
  
  Examples
  --------
  `LabelEncoder` can be used to normalize labels.
  
  >>> from sklearn.preprocessing import LabelEncoder
  >>> le = LabelEncoder()
  >>> le.fit([1, 2, 2, 6])
  LabelEncoder()
  >>> le.classes_
  array([1, 2, 6])
  >>> le.transform([1, 1, 2, 6])
  array([0, 0, 1, 2]...)
  >>> le.inverse_transform([0, 0, 1, 2])
  array([1, 1, 2, 6])
  
  It can also be used to transform non-numerical labels (as long as they are
  hashable and comparable) to numerical labels.
  
  >>> le = LabelEncoder()
  >>> le.fit(["paris", "paris", "tokyo", "amsterdam"])
  LabelEncoder()
  >>> list(le.classes_)
  ['amsterdam', 'paris', 'tokyo']
  >>> le.transform(["tokyo", "tokyo", "paris"])
  array([2, 2, 1]...)
  >>> list(le.inverse_transform([2, 2, 1]))
  ['tokyo', 'tokyo', 'paris']
class_docstr_tok: ["Encode","target","labels","with","value","between","0","and","n_classes-1",".","This","transformer","should","be","used","to","encode","target","values",",","*","i.e",".","*","`","y","`",",","and","not","the","input","`","X","`",".","Read","more","in","the",":","ref",":","`","User","Guide","<","preprocessing_targets",">","`",".","..","versionadded",":",":","0.12","Attributes","--","--","--","--","--","classes_",":","ndarray","of","shape","(","n_classes",",",")","Holds","the","label","for","each","class",".","See","Also","--","--","--","--","OrdinalEncoder",":","Encode","categorical","features","using","an","ordinal","encoding","scheme",".","OneHotEncoder",":","Encode","categorical","features","as","a","one-hot","numeric","array",".","Examples","--","--","--","--","`","LabelEncoder","`","can","be","used","to","normalize","labels",".",">",">",">","from","sklearn.preprocessing","import","LabelEncoder",">",">",">","le","=","LabelEncoder","(",")",">",">",">","le.fit","(","[","1",",","2",",","2",",","6","]",")","LabelEncoder","(",")",">",">",">","le.classes_","array","(","[","1",",","2",",","6","]",")",">",">",">","le.transform","(","[","1",",","1",",","2",",","6","]",")","array","(","[","0",",","0",",","1",",","2","]","...",")",">",">",">","le.inverse_transform","(","[","0",",","0",",","1",",","2","]",")","array","(","[","1",",","1",",","2",",","6","]",")","It","can","also","be","used","to","transform","non-numerical","labels","(","as","long","as","they","are","hashable","and","comparable",")","to","numerical","labels",".",">",">",">","le","=","LabelEncoder","(",")",">",">",">","le.fit","(","[","``","paris","''",",","``","paris","''",",","``","tokyo","''",",","``","amsterdam","''","]",")","LabelEncoder","(",")",">",">",">","list","(","le.classes_",")","[","'amsterdam","'",",","'paris","'",",","'tokyo","'","]",">",">",">","le.transform","(","[","``","tokyo","''",",","``","tokyo","''",",","``","paris","''","]",")","array","(","[","2",",","2",",","1","]","...",")",">",">",">","list","(","le.inverse_transform","(","[","2",",","2",",","1","]",")",")","[","'tokyo","'",",","'tokyo","'",",","'paris","'","]"]
docstr: Fit label encoder and return encoded labels.
  
  Parameters
  ----------
  y : array-like of shape (n_samples,)
      Target values.
  
  Returns
  -------
  y : array-like of shape (n_samples,)
      Encoded labels.
docstr_tok: ["Fit","label","encoder","and","return","encoded","labels",".","Parameters","--","--","--","--","--","y",":","array-like","of","shape","(","n_samples",",",")","Target","values",".","Returns","--","--","--","-","y",":","array-like","of","shape","(","n_samples",",",")","Encoded","labels","."]
code: def fit_transform(self, y):
      """Fit label encoder and return encoded labels.
  
      Parameters
      ----------
      y : array-like of shape (n_samples,)
          Target values.
  
      Returns
      -------
      y : array-like of shape (n_samples,)
          Encoded labels.
      """
      y = column_or_1d(y, warn=True)
      self.classes_, y = _unique(y, return_inverse=True)
      return y
  
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 2 for calling the LabelEncoder obj's underlying member method code with example usage: obj.fit_transform(y) and returns: y