class_docstr: Defines the ExplainerManager for explaining a model.
class_docstr_tok: ["Defines","the","ExplainerManager","for","explaining","a","model","."]
code: def _get_interpret(self, explanation, evaluation_examples=None):
      interpretation = ModelExplanationData()
  
      # List of explanations, key of explanation type is "explanation_type"
      if explanation is not None:
          mli_explanations = explanation.data(-1)["mli"]
      else:
          mli_explanations = None
      local_explanation = self._find_first_explanation(
          ExplanationKeys.LOCAL_EXPLANATION_KEY, mli_explanations
      )
      global_explanation = self._find_first_explanation(
          ExplanationKeys.GLOBAL_EXPLANATION_KEY, mli_explanations
      )
      ebm_explanation = self._find_first_explanation(
          ExplanationKeys.EBM_GLOBAL_EXPLANATION_KEY, mli_explanations
      )
  
      if explanation is not None and hasattr(explanation, "method"):
          interpretation.method = explanation.method
  
      local_dim = None
  
      if (
          local_explanation is not None
          or global_explanation is not None
          or ebm_explanation is not None
      ):
          interpretation.precomputedExplanations = (
              PrecomputedExplanations()
          )
  
      if local_explanation is not None:
          try:
              local_feature_importance = FeatureImportance()
              local_feature_importance.scores = convert_to_list(
                  local_explanation["scores"]
              )
              if np.shape(local_feature_importance.scores)[-1] > 1000:
                  raise ValueError(
                      "Exceeds maximum number of features for "
                      "visualization (1000). Please regenerate"
                      " the explanation using fewer features."
                  )
              local_feature_importance.intercept = convert_to_list(
                  local_explanation["intercept"]
              )
              # We can ignore perf explanation data.
              # Note if it is added back at any point,
              # the numpy values will need to be converted to python,
              # otherwise serialization fails.
              local_explanation["perf"] = None
              interpretation.precomputedExplanations.localFeatureImportance = (
                  local_feature_importance
              )
          except Exception as ex:
              raise ValueError(
                  "Unsupported local explanation type"
              ) from ex
  
          if evaluation_examples is not None:
              _feature_length = evaluation_examples.shape[1]
              _row_length = evaluation_examples.shape[0]
              local_dim = np.shape(local_feature_importance.scores)
              if len(local_dim) != 2 and len(local_dim) != 3:
                  raise ValueError(
                      "Local explanation expected to be a 2D or 3D list"
                  )
              if len(local_dim) == 2 and (
                  local_dim[1] != _feature_length
                  or local_dim[0] != _row_length
              ):
                  raise ValueError(
                      "Shape mismatch: local explanation"
                      "length differs from dataset"
                  )
              if len(local_dim) == 3 and (
                  local_dim[2] != _feature_length
                  or local_dim[1] != _row_length
              ):
                  raise ValueError(
                      "Shape mismatch: local explanation"
                      " length differs from dataset"
                  )
      if global_explanation is not None:
          try:
              global_feature_importance = FeatureImportance()
              global_feature_importance.scores = convert_to_list(
                  global_explanation["scores"]
              )
              if "intercept" in global_explanation:
                  global_feature_importance.intercept = convert_to_list(
                      global_explanation["intercept"]
                  )
              interpretation.precomputedExplanations.globalFeatureImportance = (
                  global_explanation
              )
          except Exception as ex:
              raise ValueError(
                  "Unsupported global explanation type"
              ) from ex
      if ebm_explanation is not None:
          try:
              ebm_feature_importance = EBMGlobalExplanation()
              ebm_feature_importance.feature_list = ebm_explanation[
                  "feature_list"
              ]
              interpretation.precomputedExplanations.ebmGlobalExplanation = (
                  ebm_feature_importance
              )
  
          except Exception as ex:
              raise ValueError(
                  "Unsupported ebm explanation type"
              ) from ex
      return interpretation
  
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 10 for calling the ExplainerManager obj's underlying member method code with example usage: obj._get_interpret(explanation, evaluation_examples) and returns: interpretation