class_docstr: Abstract base class for Gradient Boosting.
class_docstr_tok: ["Abstract","base","class","for","Gradient","Boosting","."]
docstr: Fast partial dependence computation.
  
  Parameters
  ----------
  grid : ndarray of shape (n_samples, n_target_features)
      The grid points on which the partial dependence should be
      evaluated.
  target_features : ndarray of shape (n_target_features,)
      The set of target features for which the partial dependence
      should be evaluated.
  
  Returns
  -------
  averaged_predictions : ndarray of 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 of shape (n_samples, n_target_features)
              The grid points on which the partial dependence should be
              evaluated.
          target_features : ndarray of shape (n_target_features,)
              The set of target features for which the partial dependence
              should be evaluated.
  
          Returns
          -------
          averaged_predictions : ndarray of shape \
                  (n_trees_per_iteration, n_samples)
              The value of the partial dependence function on each grid point.
          """
      if self.init is not None:
          warnings.warn(
              "Using recursion method with a non-constant init predictor "
              "will lead to incorrect partial dependence values. "
              "Got init=%s." % self.init,
              UserWarning,
          )
      grid = np.asarray(grid, dtype=DTYPE, order="C")
      n_estimators, n_trees_per_stage = self.estimators_.shape
      averaged_predictions = np.zeros(
          (n_trees_per_stage, grid.shape[0]),
          dtype=np.float64,
          order="C",
      )
      for stage in range(n_estimators):
          for k in range(n_trees_per_stage):
              tree = self.estimators_[stage, k].tree_
              tree.compute_partial_dependence(
                  grid, target_features, averaged_predictions[k]
              )
      averaged_predictions *= self.learning_rate
  
      return averaged_predictions
  
imports: import warnings
  from abc import ABCMeta, abstractmethod
  from numbers import Integral, Real
  from time import time
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix, issparse
  from ..base import ClassifierMixin, RegressorMixin, _fit_context, is_classifier
  from ..exceptions import NotFittedError
  from ..model_selection import train_test_split
  from ..tree import DecisionTreeRegressor
  from ..tree._tree import DOUBLE, DTYPE
  from ..utils import check_array, check_random_state, column_or_1d
  from ..utils._param_validation import HasMethods, Interval, StrOptions
  from ..utils.multiclass import check_classification_targets
  from ..utils.validation import _check_sample_weight, check_is_fitted
  from .None import _gb_losses
  from ._base import BaseEnsemble
  from ._gradient_boosting import _random_sample_mask, predict_stage, predict_stages
label_desc: Use image node_id 17 for calling the BaseGradientBoosting obj's underlying member method code with example usage: obj._compute_partial_dependence_recursion(grid, target_features) and returns: averaged_predictions