class_docstr: Bin continuous data into intervals.
  
  Parameters
  ----------
  n_bins : int or array-like, shape (n_features,) (default=5)
      The number of bins to produce. Raises ValueError if ``n_bins < 2``.
  
  encode : {'onehot', 'onehot-dense', 'ordinal'}, (default='onehot')
      Method used to encode the transformed result.
  
      onehot
          Encode the transformed result with one-hot encoding
          and return a sparse matrix. Ignored features are always
          stacked to the right.
      onehot-dense
          Encode the transformed result with one-hot encoding
          and return a dense array. Ignored features are always
          stacked to the right.
      ordinal
          Return the bin identifier encoded as an integer value.
  
  strategy : {'uniform', 'quantile', 'kmeans'}, (default='quantile')
      Strategy used to define the widths of the bins.
  
      uniform
          All bins in each feature have identical widths.
      quantile
          All bins in each feature have the same number of points.
      kmeans
          Values in each bin have the same nearest center of a 1D k-means
          cluster.
  
  Attributes
  ----------
  n_bins_ : int array, shape (n_features,)
      Number of bins per feature. Bins whose width are too small
      (i.e., <= 1e-8) are removed with a warning.
  
  bin_edges_ : array of arrays, shape (n_features, )
      The edges of each bin. Contain arrays of varying shapes ``(n_bins_, )``
      Ignored features will have empty arrays.
  
  See Also
  --------
   cuml.preprocessing.Binarizer : Class used to bin values as ``0`` or
      ``1`` based on a parameter ``threshold``.
  
  Notes
  -----
  In bin edges for feature ``i``, the first and last values are used only for
  ``inverse_transform``. During transform, bin edges are extended to::
  
    np.concatenate([-np.inf, bin_edges_[i][1:-1], np.inf])
  
  You can combine ``KBinsDiscretizer`` with
  :class:`cuml.compose.ColumnTransformer` if you only want to preprocess
  part of the features.
  
  ``KBinsDiscretizer`` might produce constant features (e.g., when
  ``encode = 'onehot'`` and certain bins do not contain any data).
  These features can be removed with feature selection algorithms
  (e.g., :class:`sklearn.feature_selection.VarianceThreshold`).
  
  Examples
  --------
  >>> from cuml.preprocessing import KBinsDiscretizer
  >>> import cupy as cp
  >>> X = [[-2, 1, -4,   -1],
  ...      [-1, 2, -3, -0.5],
  ...      [ 0, 3, -2,  0.5],
  ...      [ 1, 4, -1,    2]]
  >>> X = cp.array(X)
  >>> est = KBinsDiscretizer(n_bins=3, encode='ordinal', strategy='uniform')
  >>> est.fit(X)
  KBinsDiscretizer(...)
  >>> Xt = est.transform(X)
  >>> Xt
  array([[0, 0, 0, 0],
         [1, 1, 1, 0],
         [2, 2, 2, 1],
         [2, 2, 2, 2]], dtype=int32)
  
  Sometimes it may be useful to convert the data back into the original
  feature space. The ``inverse_transform`` function converts the binned
  data into the original feature space. Each value will be equal to the mean
  of the two bin edges.
  
  >>> est.bin_edges_[0]
  array([-2., -1.,  0.,  1.])
  >>> est.inverse_transform(Xt)
  array([[-1.5,  1.5, -3.5, -0.5],
         [-0.5,  2.5, -2.5, -0.5],
         [ 0.5,  3.5, -1.5,  0.5],
         [ 0.5,  3.5, -1.5,  1.5]])
class_docstr_tok: ["Bin","continuous","data","into","intervals",".","Parameters","--","--","--","--","--","n_bins",":","int","or","array-like",",","shape","(","n_features",",",")","(","default=5",")","The","number","of","bins","to","produce",".","Raises","ValueError","if","``","n_bins","<","2","``",".","encode",":","{","'onehot","'",",","'onehot-dense","'",",","'ordinal","'","}",",","(","default='onehot","'",")","Method","used","to","encode","the","transformed","result",".","onehot","Encode","the","transformed","result","with","one-hot","encoding","and","return","a","sparse","matrix",".","Ignored","features","are","always","stacked","to","the","right",".","onehot-dense","Encode","the","transformed","result","with","one-hot","encoding","and","return","a","dense","array",".","Ignored","features","are","always","stacked","to","the","right",".","ordinal","Return","the","bin","identifier","encoded","as","an","integer","value",".","strategy",":","{","'uniform","'",",","'quantile","'",",","'kmeans","'","}",",","(","default='quantile","'",")","Strategy","used","to","define","the","widths","of","the","bins",".","uniform","All","bins","in","each","feature","have","identical","widths",".","quantile","All","bins","in","each","feature","have","the","same","number","of","points",".","kmeans","Values","in","each","bin","have","the","same","nearest","center","of","a","1D","k-means","cluster",".","Attributes","--","--","--","--","--","n_bins_",":","int","array",",","shape","(","n_features",",",")","Number","of","bins","per","feature",".","Bins","whose","width","are","too","small","(","i.e.",",","<","=","1e-8",")","are","removed","with","a","warning",".","bin_edges_",":","array","of","arrays",",","shape","(","n_features",",",")","The","edges","of","each","bin",".","Contain","arrays","of","varying","shapes","``","(","n_bins_",",",")","``","Ignored","features","will","have","empty","arrays",".","See","Also","--","--","--","--","cuml.preprocessing.Binarizer",":","Class","used","to","bin","values","as","``","0","``","or","``","1","``","based","on","a","parameter","``","threshold","``",".","Notes","--","--","-","In","bin","edges","for","feature","``","i","``",",","the","first","and","last","values","are","used","only","for","``","inverse_transform","``",".","During","transform",",","bin","edges","are","extended","to",":",":","np.concatenate","(","[","-np.inf",",","bin_edges_","[","i","]","[","1",":","-1","]",",","np.inf","]",")","You","can","combine","``","KBinsDiscretizer","``","with",":","class",":","`","cuml.compose.ColumnTransformer","`","if","you","only","want","to","preprocess","part","of","the","features",".","``","KBinsDiscretizer","``","might","produce","constant","features","(","e.g.",",","when","``","encode","=","'onehot","'","``","and","certain","bins","do","not","contain","any","data",")",".","These","features","can","be","removed","with","feature","selection","algorithms","(","e.g.",",",":","class",":","`","sklearn.feature_selection.VarianceThreshold","`",")",".","Examples","--","--","--","--",">",">",">","from","cuml.preprocessing","import","KBinsDiscretizer",">",">",">","import","cupy","as","cp",">",">",">","X","=","[","[","-2",",","1",",","-4",",","-1","]",",","...","[","-1",",","2",",","-3",",","-0.5","]",",","...","[","0",",","3",",","-2",",","0.5","]",",","...","[","1",",","4",",","-1",",","2","]","]",">",">",">","X","=","cp.array","(","X",")",">",">",">","est","=","KBinsDiscretizer","(","n_bins=3",",","encode='ordinal","'",",","strategy='uniform","'",")",">",">",">","est.fit","(","X",")","KBinsDiscretizer","(","...",")",">",">",">","Xt","=","est.transform","(","X",")",">",">",">","Xt","array","(","[","[","0",",","0",",","0",",","0","]",",","[","1",",","1",",","1",",","0","]",",","[","2",",","2",",","2",",","1","]",",","[","2",",","2",",","2",",","2","]","]",",","dtype=int32",")","Sometimes","it","may","be","useful","to","convert","the","data","back","into","the","original","feature","space",".","The","``","inverse_transform","``","function","converts","the","binned","data","into","the","original","feature","space",".","Each","value","will","be","equal","to","the","mean","of","the","two","bin","edges",".",">",">",">","est.bin_edges_","[","0","]","array","(","[","-2.",",","-1.",",","0.",",","1",".","]",")",">",">",">","est.inverse_transform","(","Xt",")","array","(","[","[","-1.5",",","1.5",",","-3.5",",","-0.5","]",",","[","-0.5",",","2.5",",","-2.5",",","-0.5","]",",","[","0.5",",","3.5",",","-1.5",",","0.5","]",",","[","0.5",",","3.5",",","-1.5",",","1.5","]","]",")"]
code: def bin_edges_(self):
      return self.bin_edges_internal_
  
imports: from ....internals import _deprecate_pos_args
  from ....internals.memory_utils import using_output_type
  from ....common.array_descriptor import CumlArrayDescriptor
  from ....internals.array_sparse import SparseCumlArray
  from ....thirdparty_adapters import check_array
  from ..utils.validation import FLOAT_DTYPES
  from ..utils.validation import check_is_fitted
  from cuml.internals.mixins import SparseInputTagMixin
  from ..utils.skl_dependencies import BaseEstimator, TransformerMixin
  from cuml.cluster import KMeans
  from cuml.preprocessing import OneHotEncoder
  import warnings
  from cuml.internals.safe_imports import cpu_only_import
  import numbers
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 7 for calling the KBinsDiscretizer obj's underlying member method code with example usage: obj.bin_edges_() and returns: self