class_docstr: A distributed version of LabelBinarizer for one-hot encoding
  a collection of labels.
  
  Examples
  --------
  
  Create an array with labels and dummy encode them
  
  .. code-block:: python
  
      >>> import cupy as cp
      >>> import cupyx
      >>> from cuml.dask.preprocessing import LabelBinarizer
  
      >>> from dask_cuda import LocalCUDACluster
      >>> from dask.distributed import Client
      >>> import dask
  
      >>> cluster = LocalCUDACluster()
      >>> client = Client(cluster)
  
      >>> labels = cp.asarray([0, 5, 10, 7, 2, 4, 1, 0, 0, 4, 3, 2, 1],
      ...                     dtype=cp.int32)
      >>> labels = dask.array.from_array(labels)
  
      >>> lb = LabelBinarizer()
      >>> encoded = lb.fit_transform(labels)
      >>> print(encoded.compute())
      [[1 0 0 0 0 0 0 0]
      [0 0 0 0 0 1 0 0]
      [0 0 0 0 0 0 0 1]
      [0 0 0 0 0 0 1 0]
      [0 0 1 0 0 0 0 0]
      [0 0 0 0 1 0 0 0]
      [0 1 0 0 0 0 0 0]
      [1 0 0 0 0 0 0 0]
      [1 0 0 0 0 0 0 0]
      [0 0 0 0 1 0 0 0]
      [0 0 0 1 0 0 0 0]
      [0 0 1 0 0 0 0 0]
      [0 1 0 0 0 0 0 0]]
      >>> decoded = lb.inverse_transform(encoded)
      >>> print(decoded.compute())
      [ 0  5 10  7  2  4  1  0  0  4  3  2  1]
      >>> client.close()
      >>> cluster.close()
class_docstr_tok: ["A","distributed","version","of","LabelBinarizer","for","one-hot","encoding","a","collection","of","labels",".","Examples","--","--","--","--","Create","an","array","with","labels","and","dummy","encode","them","..","code-block",":",":","python",">",">",">","import","cupy","as","cp",">",">",">","import","cupyx",">",">",">","from","cuml.dask.preprocessing","import","LabelBinarizer",">",">",">","from","dask_cuda","import","LocalCUDACluster",">",">",">","from","dask.distributed","import","Client",">",">",">","import","dask",">",">",">","cluster","=","LocalCUDACluster","(",")",">",">",">","client","=","Client","(","cluster",")",">",">",">","labels","=","cp.asarray","(","[","0",",","5",",","10",",","7",",","2",",","4",",","1",",","0",",","0",",","4",",","3",",","2",",","1","]",",","...","dtype=cp.int32",")",">",">",">","labels","=","dask.array.from_array","(","labels",")",">",">",">","lb","=","LabelBinarizer","(",")",">",">",">","encoded","=","lb.fit_transform","(","labels",")",">",">",">","print","(","encoded.compute","(",")",")","[","[","1","0","0","0","0","0","0","0","]","[","0","0","0","0","0","1","0","0","]","[","0","0","0","0","0","0","0","1","]","[","0","0","0","0","0","0","1","0","]","[","0","0","1","0","0","0","0","0","]","[","0","0","0","0","1","0","0","0","]","[","0","1","0","0","0","0","0","0","]","[","1","0","0","0","0","0","0","0","]","[","1","0","0","0","0","0","0","0","]","[","0","0","0","0","1","0","0","0","]","[","0","0","0","1","0","0","0","0","]","[","0","0","1","0","0","0","0","0","]","[","0","1","0","0","0","0","0","0","]","]",">",">",">","decoded","=","lb.inverse_transform","(","encoded",")",">",">",">","print","(","decoded.compute","(",")",")","[","0","5","10","7","2","4","1","0","0","4","3","2","1","]",">",">",">","client.close","(",")",">",">",">","cluster.close","(",")"]
docstr: Transform and return encoded labels
  
  Parameters
  ----------
  y : Dask.Array of shape [n_samples,] or [n_samples, n_classes]
  
  Returns
  -------
  
  arr : Dask.Array backed by CuPy arrays containing encoded labels
docstr_tok: ["Transform","and","return","encoded","labels","Parameters","--","--","--","--","--","y",":","Dask.Array","of","shape","[","n_samples",",","]","or","[","n_samples",",","n_classes","]","Returns","--","--","--","-","arr",":","Dask.Array","backed","by","CuPy","arrays","containing","encoded","labels"]
code: def transform(self, y):
      """
      Transform and return encoded labels
  
      Parameters
      ----------
      y : Dask.Array of shape [n_samples,] or [n_samples, n_classes]
  
      Returns
      -------
  
      arr : Dask.Array backed by CuPy arrays containing encoded labels
      """
  
      parts = self.client.sync(_extract_partitions, y)
  
      internal_model = self._get_internal_model()
  
      xform_func = dask.delayed(LabelBinarizer._func_xform)
      meta = rmm_cupy_ary(cp.zeros, 1)
      if internal_model.sparse_output:
          meta = cupyx.scipy.sparse.csr_matrix(meta)
      f = [
          dask.array.from_delayed(
              xform_func(internal_model, part),
              meta=meta,
              dtype=cp.float32,
              shape=(cp.nan, len(self.classes_)),
          )
          for w, part in parts
      ]
  
      arr = dask.array.concatenate(
          f, axis=0, allow_unknown_chunksizes=True
      )
      return arr
  
file_path: cuml/python/cuml/dask/preprocessing/label.py
imports: from cuml.preprocessing.label import LabelBinarizer
  from cuml.dask.common.input_utils import _extract_partitions
  from cuml.dask.common.base import BaseEstimator
  from cuml.common import rmm_cupy_ary
  import dask
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 8 for calling the LabelBinarizer obj's underlying member method code with example usage: obj.transform(y) and returns: arr