docstr: Uses the metadata returned by the anchor search algorithm together with
  the instance to be explained to build an explanation object.
  
  Parameters
  ----------
  image
      Instance to be explained.
  result
      Dictionary containing the search anchor and metadata.
  predicted_label
      Label of the instance to be explained.
  params
      Parameters passed to `:py:meth:alibi.explainers.anchor_image.AnchorImage.explain`.
docstr_tok: ["Uses","the","metadata","returned","by","the","anchor","search","algorithm","together","with","the","instance","to","be","explained","to","build","an","explanation","object",".","Parameters","--","--","--","--","--","image","Instance","to","be","explained",".","result","Dictionary","containing","the","search","anchor","and","metadata",".","predicted_label","Label","of","the","instance","to","be","explained",".","params","Parameters","passed","to","`",":","py",":","meth",":","alibi.explainers.anchor_image.AnchorImage.explain","`","."]
code: def _build_explanation(
      self,
      image: np.ndarray,
      result: dict,
      predicted_label: int,
      params: dict,
      sampler: AnchorImageSampler,
  ) -> Explanation:
      """
      Uses the metadata returned by the anchor search algorithm together with
      the instance to be explained to build an explanation object.
  
      Parameters
      ----------
      image
          Instance to be explained.
      result
          Dictionary containing the search anchor and metadata.
      predicted_label
          Label of the instance to be explained.
      params
          Parameters passed to `:py:meth:alibi.explainers.anchor_image.AnchorImage.explain`.
      """
  
      result["instance"] = image
      result["instances"] = np.expand_dims(image, 0)
      result["prediction"] = np.array([predicted_label])
  
      # overlay image with anchor mask
      anchor = self.overlay_mask(
          image, sampler.segments, result["feature"]
      )
      exp = AnchorExplanation("image", result)
  
      # output explanation dictionary
      data = copy.deepcopy(DEFAULT_DATA_ANCHOR_IMG)
      data.update(
          anchor=anchor,
          segments=sampler.segments,
          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
  import logging
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
  import numpy
  from skimage.segmentation import felzenszwalb, quickshift, slic
  from alibi.api.defaults import DEFAULT_DATA_ANCHOR_IMG, DEFAULT_META_ANCHOR
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.exceptions import PredictorCallError, PredictorReturnTypeError
  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 AnchorImage obj's underlying member method code with example usage: obj._build_explanation(image, result, predicted_label, params, sampler) and returns: explanation