class_docstr: Counterfactual Reinforcement Learning. 
class_docstr_tok: ["Counterfactual","Reinforcement","Learning","."]
docstr: Builds the explanation of the current object.
  
  Parameters
  ----------
  X
      Inputs instance in the original format.
  Y_m
      Inputs classification labels.
  X_cf
      Counterfactuals instances in the original format.
  Y_m_cf
      Counterfactuals classification labels.
  Y_t
      Target labels.
  C
      Condition vector. If ``None``, it means that no conditioning was used during training (i.e. the
      `conditional_func` returns ``None``).
  
  Returns
  -------
  `Explanation` object containing the inputs with the corresponding labels, the counterfactuals with the         corresponding labels, targets and additional metadata.
code: def _build_explanation(
      self,
      X: np.ndarray,
      Y_m: np.ndarray,
      X_cf: np.ndarray,
      Y_m_cf: np.ndarray,
      Y_t: np.ndarray,
      C: Optional[np.ndarray],
  ) -> Explanation:
      """
          Builds the explanation of the current object.
  
          Parameters
          ----------
          X
              Inputs instance in the original format.
          Y_m
              Inputs classification labels.
          X_cf
              Counterfactuals instances in the original format.
          Y_m_cf
              Counterfactuals classification labels.
          Y_t
              Target labels.
          C
              Condition vector. If ``None``, it means that no conditioning was used during training (i.e. the
              `conditional_func` returns ``None``).
  
          Returns
          -------
          `Explanation` object containing the inputs with the corresponding labels, the counterfactuals with the \
          corresponding labels, targets and additional metadata.
          """
      data = deepcopy(DEFAULT_DATA_CFRL)
  
      # update original input entrance
      data["orig"] = {}
      data["orig"].update({"X": X, "class": Y_m.reshape(-1, 1)})
  
      # update counterfactual entrance
      data["cf"] = {}
      data["cf"].update({"X": X_cf, "class": Y_m_cf.reshape(-1, 1)})
  
      # update target and condition
      data["target"] = Y_t.reshape(-1, 1)
      data["condition"] = C
      return Explanation(meta=self.meta, data=data)
  
imports: import logging
  import os
  from abc import ABC, abstractmethod
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Tuple, Union, cast
  import numpy
  from tqdm import tqdm
  from alibi.api.defaults import DEFAULT_DATA_CFRL, DEFAULT_META_CFRL
  from alibi.api.interfaces import Explainer, Explanation, FitMixin
  from alibi.explainers.backends.cfrl_base import generate_empty_condition, get_classification_reward, get_hard_distribution, identity_function
  from alibi.utils.frameworks import Framework, has_pytorch, has_tensorflow
label_desc: Use image node_id 16 for calling the CounterfactualRL obj's underlying member method code with example usage: obj._build_explanation(X, Y_m, X_cf, Y_m_cf, Y_t, C) and returns: Explanation