docstr: Predict regression value for X.
  
  Parameters
  ----------
  X : array-like or sparse matrix of shape = [n_samples, n_features]
      The input samples. Internally, it will be converted to
      ``dtype=np.float32`` and if a sparse matrix is provided
      to a sparse ``csr_matrix``.
  quantile_levels : List[float], optional
      List of quantiles (between 0.0 and 1.0) to predict. If not provided, mean is returned.
  
  Returns
  -------
  y : array
      If quantile_levels is None, then y contains E(Y | X) and has shape [n_samples].
      Otherwise, y contains the predicted quantiles and has shape [n_samples, len(quantile_levels)]
docstr_tok: ["Predict","regression","value","for","X.","Parameters","--","--","--","--","--","X",":","array-like","or","sparse","matrix","of","shape","=","[","n_samples",",","n_features","]","The","input","samples",".","Internally",",","it","will","be","converted","to","``","dtype=np.float32","``","and","if","a","sparse","matrix","is","provided","to","a","sparse","``","csr_matrix","``",".","quantile_levels",":","List","[","float","]",",","optional","List","of","quantiles","(","between","0.0","and","1.0",")","to","predict",".","If","not","provided",",","mean","is","returned",".","Returns","--","--","--","-","y",":","array","If","quantile_levels","is","None",",","then","y","contains","E","(","Y","|","X",")","and","has","shape","[","n_samples","]",".","Otherwise",",","y","contains","the","predicted","quantiles","and","has","shape","[","n_samples",",","len","(","quantile_levels",")","]"]
code: def predict(self, X, quantile_levels=None):
      """
      Predict regression value for X.
  
      Parameters
      ----------
      X : array-like or sparse matrix of shape = [n_samples, n_features]
          The input samples. Internally, it will be converted to
          ``dtype=np.float32`` and if a sparse matrix is provided
          to a sparse ``csr_matrix``.
      quantile_levels : List[float], optional
          List of quantiles (between 0.0 and 1.0) to predict. If not provided, mean is returned.
  
      Returns
      -------
      y : array
          If quantile_levels is None, then y contains E(Y | X) and has shape [n_samples].
          Otherwise, y contains the predicted quantiles and has shape [n_samples, len(quantile_levels)]
      """
      # apply method requires X to be of dtype np.float32
      X = check_array(X, dtype=np.float32, accept_sparse="csc")
      if quantile_levels is None:
          return super(BaseForestQuantileRegressor, self).predict(X)
      elif isinstance(quantile_levels, float):
          quantile_levels = [quantile_levels]
  
      X_leaves = self.apply(X)
  
      samples_with_weighted_neighbors = (
          get_weighted_neighbors_dataframe(
              X_leaves=X_leaves,
              y_train_leaves=self.y_train_leaves_,
              y_train=self.y_train_,
              y_weights=self.y_weights_,
          )
      )
      quantile_preds = samples_with_weighted_neighbors.groupby(
          "item_id"
      ).apply(partial(get_quantiles, quantile_levels=quantile_levels))
      return np.stack(quantile_preds.values.tolist())
  
imports: import logging
  from functools import partial
  import numpy
  import pandas
  from sklearn.ensemble._forest import ForestRegressor
  from sklearn.tree import BaseDecisionTree, DecisionTreeRegressor, ExtraTreeRegressor
  from sklearn.utils import check_array, check_random_state, check_X_y
label_desc: Use image node_id 2 for calling the BaseForestQuantileRegressor obj's underlying member method code with example usage: obj.predict(X, quantile_levels) and returns: np, super