class_docstr: A label encoder that supports specifying a positive class on top of sklearn's LabelEncoder.
class_docstr_tok: ["A","label","encoder","that","supports","specifying","a","positive","class","on","top","of","sklearn","'s","LabelEncoder","."]
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 = self._le.fit_transform(y)
      self._set_attributes()
  
      if self._mapping is not None:
          return self._mapping[y]
      else:
          return y
  
imports: import json
  import logging
  import re
  from typing import Any, Dict, List, Optional, Union
  import jsonschema
  import numpy
  import pandas
  from omegaconf import DictConfig, OmegaConf
  from sklearn.preprocessing import LabelEncoder
  from ..constants import AUTOMM, END_OFFSET, ENTITY_GROUP, NER_ANNOTATION, PROBABILITY, START_OFFSET
label_desc: Use image node_id 4 for calling the CustomLabelEncoder obj's underlying member method code with example usage: obj.fit_transform(y) and returns: self, y