class_docstr: Defines the ExplainerManager for explaining a model.
class_docstr_tok: ["Defines","the","ExplainerManager","for","explaining","a","model","."]
docstr: Compute explanations using MimicExplainer.
  
  :param local: True if local explanations are requested
          and False otherwise.
  :type local: bool
  :param data: The data point(s) for which the explanations
               need to be generated.
  :type data: Any
  :return: The computed explanations.
  :rtype: Any
docstr_tok: ["Compute","explanations","using","MimicExplainer",".",":","param","local",":","True","if","local","explanations","are","requested","and","False","otherwise",".",":","type","local",":","bool",":","param","data",":","The","data","point","(","s",")","for","which","the","explanations","need","to","be","generated",".",":","type","data",":","Any",":","return",":","The","computed","explanations",".",":","rtype",":","Any"]
code: def _compute_explanations(self, local: bool, data: Any):
      """Compute explanations using MimicExplainer.
  
      :param local: True if local explanations are requested
              and False otherwise.
      :type local: bool
      :param data: The data point(s) for which the explanations
                   need to be generated.
      :type data: Any
      :return: The computed explanations.
      :rtype: Any
      """
      if self._classes is not None:
          model_task = ModelTask.Classification
      else:
          model_task = ModelTask.Regression
  
      explainer = MimicExplainer(
          self._model,
          self._initialization_examples,
          self._surrogate_model,
          features=self._features,
          model_task=model_task,
          classes=self._classes,
          categorical_features=self._categorical_features,
      )
  
      if len(data) <= MAXIMUM_ROWS_FOR_GLOBAL_EXPLANATIONS:
          return explainer.explain_global(data, include_local=local)
      else:
          warnings.warn(
              (
                  "LARGE-DATA-SCENARIO-DETECTED: "
                  "The data is larger than the supported limit of {0}. "
                  "Computing explanations for first {0} samples only."
              ).format(MAXIMUM_ROWS_FOR_GLOBAL_EXPLANATIONS),
              UserWarning,
          )
          return explainer.explain_global(
              data[0:MAXIMUM_ROWS_FOR_GLOBAL_EXPLANATIONS],
              include_local=local,
          )
  
imports: import json
  import warnings
  from pathlib import Path
  from typing import Any, List, Optional
  import numpy
  import pandas
  from interpret_community.explanation.explanation import FeatureImportanceExplanation, load_explanation, save_explanation
  from interpret_community.mimic.mimic_explainer import MimicExplainer
  from interpret_community.mimic.models.lightgbm_model import LGBMExplainableModel
  from interpret_community.mimic.models.linear_model import LinearExplainableModel
  from scipy.sparse import issparse
  from raiutils.data_processing import convert_to_list
  from raiutils.exceptions import UserConfigValidationException
  from raiutils.models import ModelTask
  from responsibleai._interfaces import EBMGlobalExplanation, FeatureImportance, ModelExplanationData, PrecomputedExplanations
  from responsibleai._internal.constants import ExplainerManagerKeys
  from responsibleai._internal.constants import ExplanationKeys, ListProperties, ManagerNames, Metadata
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.managers.base_manager import BaseManager
  from responsibleai.utils import _find_features_having_missing_values, _measure_time
label_desc: Use image node_id 4 for calling the ExplainerManager obj's underlying member method code with example usage: obj._compute_explanations(local, data) and returns: explainer, explainer