docstr: Preprocess search output and return an explanation object containing metdata
  
  Parameters
  ----------
  X
      Instance to be explained.
  result
      Dictionary with explanation search output and metadata.
  predicted_label
      Label of the instance to be explained (inferred if not given).
  params
      Parameters passed to :py:meth:`alibi.explainers.anchors.anchor_tabular.AnchorTabular.explain`.
  
  Return
  ------
  `Explanation` object containing the anchor explaining the instance with additional metadata as attributes. 
code: def _build_explanation(
      self,
      X: np.ndarray,
      result: dict,
      predicted_label: int,
      params: dict,
  ) -> Explanation:
      """
          Preprocess search output and return an explanation object containing metdata
  
          Parameters
          ----------
          X
              Instance to be explained.
          result
              Dictionary with explanation search output and metadata.
          predicted_label
              Label of the instance to be explained (inferred if not given).
          params
              Parameters passed to :py:meth:`alibi.explainers.anchors.anchor_tabular.AnchorTabular.explain`.
  
          Return
          ------
          `Explanation` object containing the anchor explaining the instance with additional metadata as attributes. \
  
          """
  
      self.add_names_to_exp(result)
      result["prediction"] = np.array([predicted_label])
      result["instance"] = (
          ord_to_ohe(np.atleast_2d(X), self.cat_vars_ord)[0].reshape(-1)
          if self.ohe
          else X
      )
      result["instances"] = (
          ord_to_ohe(np.atleast_2d(X), self.cat_vars_ord)[0]
          if self.ohe
          else np.atleast_2d(X)
      )
      result["examples"] = (
          [
              {
                  k: ord_to_ohe(np.atleast_2d(v), self.cat_vars_ord)[0]
                  for k, v in example.items()
                  if v.size
              }
              for example in result["examples"]
          ]
          if self.ohe
          else result["examples"]
      )
      exp = AnchorExplanation("tabular", result)
  
      # output explanation dictionary
      data = copy.deepcopy(DEFAULT_DATA_ANCHOR)
      data.update(
          anchor=exp.names(),
          precision=exp.precision(),
          coverage=exp.coverage(),
          raw=exp.exp_map,
      )
  
      # create explanation object
      explanation = Explanation(
          meta=copy.deepcopy(self.meta), data=data
      )
  
      # params passed to explain
      explanation.meta["params"].update(params)
      return explanation
  
imports: import copy
  from collections import OrderedDict, defaultdict
  from itertools import accumulate
  from typing import Any, Callable, DefaultDict, Dict, List, Optional, Set, Tuple, Type, Union
  import numpy
  from alibi.api.defaults import DEFAULT_DATA_ANCHOR, DEFAULT_META_ANCHOR
  from alibi.api.interfaces import Explainer, Explanation, FitMixin
  from alibi.exceptions import NotFittedError, PredictorCallError, PredictorReturnTypeError
  from alibi.utils.discretizer import Discretizer
  from alibi.utils.mapping import ohe_to_ord, ord_to_ohe
  from alibi.utils.wrappers import ArgmaxTransformer
  from .anchor_base import AnchorBaseBeam
  from .anchor_explanation import AnchorExplanation
label_desc: Use image node_id 5 for calling the AnchorTabular obj's underlying member method code with example usage: obj._build_explanation(X, result, predicted_label, params) and returns: explanation