class_docstr: Base class used for composite model structure definition
  
  :param model: `Pipeline` object to be explained
  :param surrogate: surrogate name. Supported surrogates: `[dt, dtreg]`
  
  .. note::
      `score` stores the score of surrogate's prediction on model (equals None if the 'explain' method hasn't been
      called yet)
class_docstr_tok: ["Base","class","used","for","composite","model","structure","definition",":","param","model",":","`","Pipeline","`","object","to","be","explained",":","param","surrogate",":","surrogate","name",".","Supported","surrogates",":","`","[","dt",",","dtreg","]","`","..","note",":",":","`","score","`","stores","the","score","of","surrogate","'s","prediction","on","model","(","equals","None","if","the","'explain","'","method","has","n't","been","called","yet",")"]
code: def explain(
      self, data: InputData, visualization: bool = False, **kwargs
  ):
      try:
          self.score = fit_naive_surrogate_model(
              self.model, self.surrogate, data
          )
  
      except Exception as ex:
          print(f"Failed to fit the surrogate: {ex}")
          return
  
      # Pruning redundant branches and leaves
      if self.surrogate_str in ("dt", "dtreg"):
          prune_duplicate_leaves(
              self.surrogate.root_node.fitted_operation
          )
  
      if visualization:
          self.visualize(**kwargs)
  
imports: import os
  from copy import deepcopy
  from inspect import signature
  from typing import Optional
  from matplotlib import pyplot
  from sklearn import tree
  from sklearn.tree._tree import TREE_LEAF
  from fedot.core.composer.metrics import Metric
  from fedot.core.composer.metrics import R2, F1
  from fedot.core.data.data import InputData
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.tasks import TaskTypesEnum
  from fedot.explainability.explainer_template import Explainer
label_desc: Use image node_id 2 for calling the SurrogateExplainer obj's underlying member method code with example usage: obj.explain(data, visualization) without return types