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","(",")"]
code: def __init__(self, *, client=None, **kwargs):
      super().__init__(client=client, **kwargs)
  
      """
          Initialize new LabelBinarizer instance
  
          Parameters
          ----------
          client : dask.Client optional client to use
          kwargs : dict of arguments to proxy to underlying single-process
                   LabelBinarizer
          """
      # Sparse output will be added once sparse CuPy arrays are supported
      # by Dask.Array: https://github.com/rapidsai/cuml/issues/1665
      if (
          "sparse_output" in self.kwargs
          and self.kwargs["sparse_output"] is True
      ):
          raise ValueError(
              "Sparse output not yet " "supported in distributed mode"
          )
  
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 1 to create a new LabelBinarizer object from inherited base classes: BaseEstimator with example: obj = LabelBinarizer()