code: def bins(self, data, labels):
      bins = []
      for feature in self.to_discretize:
          # Entropy splitting / at most 8 bins so max_depth=3
          dt = sklearn.tree.DecisionTreeClassifier(
              criterion="entropy",
              max_depth=3,
              random_state=self.random_state,
          )
          x = np.reshape(data[:, feature], (-1, 1))
          dt.fit(x, labels)
          qts = dt.tree_.threshold[
              np.where(dt.tree_.children_left > -1)
          ]
  
          if qts.shape[0] == 0:
              qts = np.array([np.median(data[:, feature])])
          else:
              qts = np.sort(qts)
  
          bins.append(qts)
  
      return bins
  
imports: import numpy
  import sklearn
  import sklearn.tree
  import scipy
  from sklearn.utils import check_random_state
  from abc import ABCMeta, abstractmethod
label_desc: Use image node_id 2 for calling the EntropyDiscretizer obj's underlying member method code with example usage: obj.bins(data, labels) and returns: bins