code: def predict(self, X):
          
          if np.any(X < self.grid[:, 0]) or np.any(X > self.grid[:, -1]):
              raise ValueError('data out of min/max bounds')
  
          binassign = np.zeros((self.n_features, len(X)), dtype=int)
          for i in range(self.n_features):
              binassign[i] = np.digitize(X[:, i], self.grid[i]) - 1
  
          labels = np.dot(self.n_bins_per_feature ** np.arange(self.n_features), binassign)
          assert np.max(labels) < self.n_bins
          return labels
docs: Get the index of the grid cell containing each sample in X
  
          Parameters
          ----------
          X : array-like, shape = [n_samples, n_features]
              New data
  
          Returns
          -------
          y : array, shape = [n_samples,]
              Index of the grid cell containing each sample