docstr: Build a forest from the training set (X, y).
  
  Parameters
  ----------
  X : array-like or sparse matrix, shape = [n_samples, n_features]
      The training input samples. Internally, it will be converted to
      ``dtype=np.float32`` and if a sparse matrix is provided
      to a sparse ``csc_matrix``.
  y : array-like, shape = [n_samples] or [n_samples, n_outputs]
      The target values (class labels) as integers or strings.
  sample_weight : array-like, shape = [n_samples] or None
      Sample weights. If None, then samples are equally weighted. Splits
      that would create child nodes with net zero or negative weight are
      ignored while searching for a split in each node. Splits are also
      ignored if they would result in any single class carrying a
      negative weight in either child node.
  
  Returns
  -------
  self : object
      Returns self.
docstr_tok: ["Build","a","forest","from","the","training","set","(","X",",","y",")",".","Parameters","--","--","--","--","--","X",":","array-like","or","sparse","matrix",",","shape","=","[","n_samples",",","n_features","]","The","training","input","samples",".","Internally",",","it","will","be","converted","to","``","dtype=np.float32","``","and","if","a","sparse","matrix","is","provided","to","a","sparse","``","csc_matrix","``",".","y",":","array-like",",","shape","=","[","n_samples","]","or","[","n_samples",",","n_outputs","]","The","target","values","(","class","labels",")","as","integers","or","strings",".","sample_weight",":","array-like",",","shape","=","[","n_samples","]","or","None","Sample","weights",".","If","None",",","then","samples","are","equally","weighted",".","Splits","that","would","create","child","nodes","with","net","zero","or","negative","weight","are","ignored","while","searching","for","a","split","in","each","node",".","Splits","are","also","ignored","if","they","would","result","in","any","single","class","carrying","a","negative","weight","in","either","child","node",".","Returns","--","--","--","-","self",":","object","Returns","self","."]
code: def fit(self, X, y, sample_weight=None):
      """
      Build a forest from the training set (X, y).
  
      Parameters
      ----------
      X : array-like or sparse matrix, shape = [n_samples, n_features]
          The training input samples. Internally, it will be converted to
          ``dtype=np.float32`` and if a sparse matrix is provided
          to a sparse ``csc_matrix``.
      y : array-like, shape = [n_samples] or [n_samples, n_outputs]
          The target values (class labels) as integers or strings.
      sample_weight : array-like, shape = [n_samples] or None
          Sample weights. If None, then samples are equally weighted. Splits
          that would create child nodes with net zero or negative weight are
          ignored while searching for a split in each node. Splits are also
          ignored if they would result in any single class carrying a
          negative weight in either child node.
  
      Returns
      -------
      self : object
          Returns self.
      """
      logger.warning(
          f"\tWARNING: {self.__class__.__name__} are experimental for quantile regression. "
          f"They may change or be removed without warning in future releases."
      )
      if sample_weight is not None:
          logger.warning(
              f"\tWARNING: {self.__class__.__name__} ignores sample_weight."
          )
  
      # apply method requires X to be of dtype np.float32
      X, y = check_X_y(
          X,
          y,
          accept_sparse="csc",
          dtype=np.float32,
          multi_output=False,
      )
      super(BaseForestQuantileRegressor, self).fit(X, y)
  
      self.y_train_ = y
      self.y_train_leaves_ = -np.ones(
          (self.n_estimators, len(y)), dtype=np.int32
      )
      self.y_weights_ = np.zeros_like(
          (self.y_train_leaves_), dtype=np.float32
      )
  
      for i, est in enumerate(self.estimators_):
          if self.bootstrap:
              bootstrap_indices = generate_sample_indices(
                  est.random_state, len(y)
              )
          else:
              bootstrap_indices = np.arange(len(y))
  
          est_weights = np.bincount(bootstrap_indices, minlength=len(y))
          y_train_leaves = est.y_train_leaves_
          # Normalize the bootstrap weights such that the total weight of each leaf sums up to 1
          # Relabel leaves starting from zero in order to efficiently count the total sum per leaf with bincount
          leaves_starting_from_zero = np.unique(
              y_train_leaves, return_inverse=True
          )[1]
          weight_per_leaf = np.bincount(
              leaves_starting_from_zero, weights=est_weights
          )
          self.y_weights_[i] = (
              est_weights / weight_per_leaf[leaves_starting_from_zero]
          )
  
          self.y_train_leaves_[i, bootstrap_indices] = y_train_leaves[
              bootstrap_indices
          ]
      return self
  
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 1 for calling the BaseForestQuantileRegressor obj's underlying member method code with example usage: obj.fit(X, y, sample_weight) and returns: self