class_docstr: Base class for histogram-based gradient boosting estimators.
class_docstr_tok: ["Base","class","for","histogram-based","gradient","boosting","estimators","."]
docstr: Fast partial dependence computation.
  
  Parameters
  ----------
  grid : ndarray, shape (n_samples, n_target_features)
      The grid points on which the partial dependence should be
      evaluated.
  target_features : ndarray, shape (n_target_features)
      The set of target features for which the partial dependence
      should be evaluated.
  
  Returns
  -------
  averaged_predictions : ndarray, shape                 (n_trees_per_iteration, n_samples)
      The value of the partial dependence function on each grid point.
docstr_tok: ["Fast","partial","dependence","computation",".","Parameters","--","--","--","--","--","grid",":","ndarray",",","shape","(","n_samples",",","n_target_features",")","The","grid","points","on","which","the","partial","dependence","should","be","evaluated",".","target_features",":","ndarray",",","shape","(","n_target_features",")","The","set","of","target","features","for","which","the","partial","dependence","should","be","evaluated",".","Returns","--","--","--","-","averaged_predictions",":","ndarray",",","shape","(","n_trees_per_iteration",",","n_samples",")","The","value","of","the","partial","dependence","function","on","each","grid","point","."]
code: def _compute_partial_dependence_recursion(
      self, grid, target_features
  ):
      """Fast partial dependence computation.
  
          Parameters
          ----------
          grid : ndarray, shape (n_samples, n_target_features)
              The grid points on which the partial dependence should be
              evaluated.
          target_features : ndarray, shape (n_target_features)
              The set of target features for which the partial dependence
              should be evaluated.
  
          Returns
          -------
          averaged_predictions : ndarray, shape \
                  (n_trees_per_iteration, n_samples)
              The value of the partial dependence function on each grid point.
          """
  
      if getattr(self, "_fitted_with_sw", False):
          raise NotImplementedError(
              "{} does not support partial dependence "
              "plots with the 'recursion' method when "
              "sample weights were given during fit "
              "time.".format(self.__class__.__name__)
          )
  
      grid = np.asarray(grid, dtype=X_DTYPE, order="C")
      averaged_predictions = np.zeros(
          (self.n_trees_per_iteration_, grid.shape[0]), dtype=Y_DTYPE
      )
  
      for predictors_of_ith_iteration in self._predictors:
          for k, predictor in enumerate(predictors_of_ith_iteration):
              predictor.compute_partial_dependence(
                  grid, target_features, averaged_predictions[k]
              )
      # Note that the learning rate is already accounted for in the leaves
      # values.
  
      return averaged_predictions
  
imports: import itertools
  from abc import ABC, abstractmethod
  from functools import partial
  from numbers import Integral, Real
  from timeit import default_timer
  import numpy
  from ..._loss.loss import _LOSSES, BaseLoss, HalfBinomialLoss, HalfGammaLoss, HalfMultinomialLoss, HalfPoissonLoss, PinballLoss
  from ...base import BaseEstimator, ClassifierMixin, RegressorMixin, _fit_context, is_classifier
  from ...metrics import check_scoring
  from ...model_selection import train_test_split
  from ...preprocessing import LabelEncoder
  from ...utils import check_random_state, compute_sample_weight, resample
  from ...utils._openmp_helpers import _openmp_effective_n_threads
  from ...utils._param_validation import Interval, RealNotInt, StrOptions
  from ...utils.multiclass import check_classification_targets
  from ...utils.validation import _check_monotonic_cst, _check_sample_weight, check_consistent_length, check_is_fitted
  from ._gradient_boosting import _update_raw_predictions
  from .binning import _BinMapper
  from .common import G_H_DTYPE, X_DTYPE, Y_DTYPE
  from .grower import TreeGrower
label_desc: Use image node_id 18 for calling the BaseHistGradientBoosting obj's underlying member method code with example usage: obj._compute_partial_dependence_recursion(grid, target_features) and returns: averaged_predictions