class_docstr: A cuDF-based implementation of ordinal label encoding
  
  Parameters
  ----------
  handle_unknown : {'error', 'ignore'}, default='error'
      Whether to raise an error or ignore if an unknown categorical feature
      is present during transform (default is to raise). When this parameter
      is set to 'ignore' and an unknown category is encountered during
      transform or inverse transform, the resulting encoding will be null.
  
  Examples
  --------
  Converting a categorical implementation to a numerical one
  
  .. code-block:: python
  
      >>> from dask_cuda import LocalCUDACluster
      >>> from dask.distributed import Client
      >>> import cudf
      >>> import dask_cudf
      >>> from cuml.dask.preprocessing import LabelEncoder
  
      >>> import pandas as pd
      >>> pd.set_option('display.max_colwidth', 2000)
  
      >>> cluster = LocalCUDACluster(threads_per_worker=1)
      >>> client = Client(cluster)
      >>> df = cudf.DataFrame({'num_col':[10, 20, 30, 30, 30],
      ...                    'cat_col':['a','b','c','a','a']})
      >>> ddf = dask_cudf.from_cudf(df, npartitions=2)
  
      >>> # There are two functionally equivalent ways to do this
      >>> le = LabelEncoder()
      >>> le.fit(ddf.cat_col)  # le = le.fit(data.category) also works
      <cuml.dask.preprocessing.LabelEncoder.LabelEncoder object at 0x...>
      >>> encoded = le.transform(ddf.cat_col)
      >>> print(encoded.compute())
      0    0
      1    1
      2    2
      3    0
      4    0
      dtype: uint8
  
      >>> # This method is preferred
      >>> le = LabelEncoder()
      >>> encoded = le.fit_transform(ddf.cat_col)
      >>> print(encoded.compute())
      0    0
      1    1
      2    2
      3    0
      4    0
      dtype: uint8
  
      >>> # We can assign this to a new column
      >>> ddf = ddf.assign(encoded=encoded.values)
      >>> print(ddf.compute())
      num_col cat_col  encoded
      0       10       a        0
      1       20       b        1
      2       30       c        2
      3       30       a        0
      4       30       a        0
      >>> # We can also encode more data
      >>> test_data = cudf.Series(['c', 'a'])
      >>> encoded = le.transform(dask_cudf.from_cudf(test_data,
      ...                                            npartitions=2))
      >>> print(encoded.compute())
      0    2
      1    0
      dtype: uint8
  
      >>> # After train, ordinal label can be inverse_transform() back to
      >>> # string labels
      >>> ord_label = cudf.Series([0, 0, 1, 2, 1])
      >>> ord_label = le.inverse_transform(
      ...    dask_cudf.from_cudf(ord_label,npartitions=2))
  
      >>> print(ord_label.compute())
      0    a
      1    a
      2    b
      0    c
      1    b
      dtype: object
      >>> client.close()
      >>> cluster.close()
class_docstr_tok: ["A","cuDF-based","implementation","of","ordinal","label","encoding","Parameters","--","--","--","--","--","handle_unknown",":","{","'error","'",",","'ignore","'","}",",","default='error'","Whether","to","raise","an","error","or","ignore","if","an","unknown","categorical","feature","is","present","during","transform","(","default","is","to","raise",")",".","When","this","parameter","is","set","to","'ignore","'","and","an","unknown","category","is","encountered","during","transform","or","inverse","transform",",","the","resulting","encoding","will","be","null",".","Examples","--","--","--","--","Converting","a","categorical","implementation","to","a","numerical","one","..","code-block",":",":","python",">",">",">","from","dask_cuda","import","LocalCUDACluster",">",">",">","from","dask.distributed","import","Client",">",">",">","import","cudf",">",">",">","import","dask_cudf",">",">",">","from","cuml.dask.preprocessing","import","LabelEncoder",">",">",">","import","pandas","as","pd",">",">",">","pd.set_option","(","'display.max_colwidth","'",",","2000",")",">",">",">","cluster","=","LocalCUDACluster","(","threads_per_worker=1",")",">",">",">","client","=","Client","(","cluster",")",">",">",">","df","=","cudf.DataFrame","(","{","'num_col","'",":","[","10",",","20",",","30",",","30",",","30","]",",","...","'cat_col","'",":","[","'","a","'",",","'","b","'",",","'","c","'",",","'","a","'",",","'","a","'","]","}",")",">",">",">","ddf","=","dask_cudf.from_cudf","(","df",",","npartitions=2",")",">",">",">","#","There","are","two","functionally","equivalent","ways","to","do","this",">",">",">","le","=","LabelEncoder","(",")",">",">",">","le.fit","(","ddf.cat_col",")","#","le","=","le.fit","(","data.category",")","also","works","<","cuml.dask.preprocessing.LabelEncoder.LabelEncoder","object","at","0x","...",">",">",">",">","encoded","=","le.transform","(","ddf.cat_col",")",">",">",">","print","(","encoded.compute","(",")",")","0","0","1","1","2","2","3","0","4","0","dtype",":","uint8",">",">",">","#","This","method","is","preferred",">",">",">","le","=","LabelEncoder","(",")",">",">",">","encoded","=","le.fit_transform","(","ddf.cat_col",")",">",">",">","print","(","encoded.compute","(",")",")","0","0","1","1","2","2","3","0","4","0","dtype",":","uint8",">",">",">","#","We","can","assign","this","to","a","new","column",">",">",">","ddf","=","ddf.assign","(","encoded=encoded.values",")",">",">",">","print","(","ddf.compute","(",")",")","num_col","cat_col","encoded","0","10","a","0","1","20","b","1","2","30","c","2","3","30","a","0","4","30","a","0",">",">",">","#","We","can","also","encode","more","data",">",">",">","test_data","=","cudf.Series","(","[","'","c","'",",","'","a","'","]",")",">",">",">","encoded","=","le.transform","(","dask_cudf.from_cudf","(","test_data",",","...","npartitions=2",")",")",">",">",">","print","(","encoded.compute","(",")",")","0","2","1","0","dtype",":","uint8",">",">",">","#","After","train",",","ordinal","label","can","be","inverse_transform","(",")","back","to",">",">",">","#","string","labels",">",">",">","ord_label","=","cudf.Series","(","[","0",",","0",",","1",",","2",",","1","]",")",">",">",">","ord_label","=","le.inverse_transform","(","...","dask_cudf.from_cudf","(","ord_label",",","npartitions=2",")",")",">",">",">","print","(","ord_label.compute","(",")",")","0","a","1","a","2","b","0","c","1","b","dtype",":","object",">",">",">","client.close","(",")",">",">",">","cluster.close","(",")"]
docstr: Simultaneously fit and transform an input
  
  This is functionally equivalent to (but faster than)
  LabelEncoder().fit(y).transform(y)
docstr_tok: ["Simultaneously","fit","and","transform","an","input","This","is","functionally","equivalent","to","(","but","faster","than",")","LabelEncoder","(",")",".fit","(","y",")",".transform","(","y",")"]
code: def fit_transform(self, y, delayed=True):
      """
      Simultaneously fit and transform an input
  
      This is functionally equivalent to (but faster than)
      LabelEncoder().fit(y).transform(y)
      """
      return self.fit(y).transform(y, delayed=delayed)
  
file_path: cuml/python/cuml/dask/preprocessing/LabelEncoder.py
imports: from cuml.preprocessing import LabelEncoder
  from cuml.common.exceptions import NotFittedError
  from dask_cudf.core import Series
  from cuml.dask.common.base import BaseEstimator
  from cuml.dask.common.base import DelayedTransformMixin
  from cuml.dask.common.base import DelayedInverseTransformMixin
  from toolz import first
  from collections.abc import Sequence
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 3 for calling the LabelEncoder obj's underlying member method code with example usage: obj.fit_transform(y, delayed) and returns: self