class_docstr: Bin continuous data into intervals sample-wise.
  
  Parameters
  ----------
  n_bins : int (default = 5)
      The number of bins to produce. The intervals for the bins are
      determined by the minimum and maximum of the input data. It must
      be greater than or equal to 2.
  
  strategy : 'uniform', 'quantile' or 'normal' (default = 'quantile')
      Strategy used to define the widths of the bins:
  
      - 'uniform': All bins in each sample have identical widths
      - 'quantile': All bins in each sample have the same number of points
      - 'normal': Bin edges are quantiles from a standard normal distribution
  
  raise_warning : bool (default = True)
      If True, a warning is raised when the number of bins is smaller for
      at least one sample. In this case, you should consider decreasing the
      number of bins or removing these samples.
  
  Examples
  --------
  >>> from pyts.preprocessing import KBinsDiscretizer
  >>> X = [[0, 1, 0, 2, 3, 3, 2, 1],
  ...      [7, 0, 6, 1, 5, 3, 4, 2]]
  >>> discretizer = KBinsDiscretizer(n_bins=2)
  >>> print(discretizer.transform(X))
  [[0 0 0 1 1 1 1 0]
   [1 0 1 0 1 0 1 0]]
class_docstr_tok: ["Bin","continuous","data","into","intervals","sample-wise",".","Parameters","--","--","--","--","--","n_bins",":","int","(","default","=","5",")","The","number","of","bins","to","produce",".","The","intervals","for","the","bins","are","determined","by","the","minimum","and","maximum","of","the","input","data",".","It","must","be","greater","than","or","equal","to","2.","strategy",":","'uniform","'",",","'quantile","'","or","'normal","'","(","default","=","'quantile","'",")","Strategy","used","to","define","the","widths","of","the","bins",":","-","'uniform","'",":","All","bins","in","each","sample","have","identical","widths","-","'quantile","'",":","All","bins","in","each","sample","have","the","same","number","of","points","-","'normal","'",":","Bin","edges","are","quantiles","from","a","standard","normal","distribution","raise_warning",":","bool","(","default","=","True",")","If","True",",","a","warning","is","raised","when","the","number","of","bins","is","smaller","for","at","least","one","sample",".","In","this","case",",","you","should","consider","decreasing","the","number","of","bins","or","removing","these","samples",".","Examples","--","--","--","--",">",">",">","from","pyts.preprocessing","import","KBinsDiscretizer",">",">",">","X","=","[","[","0",",","1",",","0",",","2",",","3",",","3",",","2",",","1","]",",","...","[","7",",","0",",","6",",","1",",","5",",","3",",","4",",","2","]","]",">",">",">","discretizer","=","KBinsDiscretizer","(","n_bins=2",")",">",">",">","print","(","discretizer.transform","(","X",")",")","[","[","0","0","0","1","1","1","1","0","]","[","1","0","1","0","1","0","1","0","]","]"]
code: def __init__(self, n_bins=5, strategy="quantile", raise_warning=True):
      self.n_bins = n_bins
      self.strategy = strategy
      self.raise_warning = raise_warning
  
imports: import numpy
  from numba import njit, prange
  from numba.typed import List
  from scipy.stats import norm
  from sklearn.base import BaseEstimator
  from sklearn.utils.validation import check_array
  from warnings import warn
  from ..base import UnivariateTransformerMixin
label_desc: Use image node_id 1 to create a new KBinsDiscretizer object from inherited base classes: BaseEstimator, UnivariateTransformerMixin with example: obj = KBinsDiscretizer(n_bins, strategy, raise_warning)