docstr: Helper method to build `Explanation` object.
  
  Parameters
  ----------
  kind
      See :py:meth:`alibi.explainers.partial_dependence.PartialDependenceBase.explain` method.
  feature_names
      List of feature or tuples of features for which the partial dependencies/individual conditional
      expectation were computed.
  pds
      List of dictionary containing the partial dependencies/individual conditional expectation.
  
  Returns
  -------
  `Explanation` object.
docstr_tok: ["Helper","method","to","build","`","Explanation","`","object",".","Parameters","--","--","--","--","--","kind","See",":","py",":","meth",":","`","alibi.explainers.partial_dependence.PartialDependenceBase.explain","`","method",".","feature_names","List","of","feature","or","tuples","of","features","for","which","the","partial","dependencies\/individual","conditional","expectation","were","computed",".","pds","List","of","dictionary","containing","the","partial","dependencies\/individual","conditional","expectation",".","Returns","--","--","--","-","`","Explanation","`","object","."]
code: def _build_explanation(
      self,
      kind: str,
      feature_names: List[Union[int, Tuple[int, int]]],
      pds: List[Dict[str, np.ndarray]],
  ) -> Explanation:
      """
      Helper method to build `Explanation` object.
  
      Parameters
      ----------
      kind
          See :py:meth:`alibi.explainers.partial_dependence.PartialDependenceBase.explain` method.
      feature_names
          List of feature or tuples of features for which the partial dependencies/individual conditional
          expectation were computed.
      pds
          List of dictionary containing the partial dependencies/individual conditional expectation.
  
      Returns
      -------
      `Explanation` object.
      """
      feature_deciles, feature_values = [], []
      pd_values: Optional[List[np.ndarray]] = (
          [] if kind in [Kind.AVERAGE, Kind.BOTH] else None
      )
      ice_values: Optional[List[np.ndarray]] = (
          [] if kind in [Kind.INDIVIDUAL, Kind.BOTH] else None
      )
  
      for pd in pds:
          feature_values.append(pd["values"])
          feature_deciles.append(pd["deciles"])
  
          if (pd_values is not None) and (Kind.AVERAGE in pd):
              pd_values.append(pd[Kind.AVERAGE])
          if (ice_values is not None) and Kind.INDIVIDUAL in pd:
              ice_values.append(pd[Kind.INDIVIDUAL])
  
      data = copy.deepcopy(DEFAULT_DATA_PD)
      data.update(
          feature_names=feature_names,
          feature_values=feature_values,
          ice_values=ice_values,
          pd_values=pd_values,
          feature_deciles=feature_deciles,
      )
      return Explanation(meta=copy.deepcopy(self.meta), data=data)
  
imports: import copy
  import logging
  import math
  import numbers
  import sys
  from abc import ABC, abstractmethod
  from enum import Enum
  from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union, no_type_check
  import matplotlib.pyplot
  import numpy
  from scipy.stats.mstats import mquantiles
  from sklearn.base import BaseEstimator, is_classifier, is_regressor
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.ensemble._gb import BaseGradientBoosting
  from sklearn.ensemble._hist_gradient_boosting.gradient_boosting import BaseHistGradientBoosting
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.utils.extmath import cartesian
  from sklearn.utils.validation import check_is_fitted
  from tqdm import tqdm
  from alibi.api.defaults import DEFAULT_DATA_PD, DEFAULT_META_PD
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.explainers.ale import get_quantiles
  from alibi.utils import _get_options_string
label_desc: Use image node_id 9 for calling the PartialDependenceBase obj's underlying member method code with example usage: obj._build_explanation(kind, feature_names, pds) and returns: Explanation