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 __init__(self, model: "Pipeline", surrogate: str):
      super().__init__(model)
  
      self.score: Optional[float] = None
  
      if not isinstance(surrogate, str):
          raise ValueError(
              f"{surrogate} is not supported as a surrogate model"
          )
      if surrogate not in self.surrogates_default_params:
          raise ValueError(
              f"{type(surrogate)} is not supported as a surrogate model"
          )
  
      self.surrogate_str = surrogate
      self.surrogate = get_simple_pipeline(
          self.surrogate_str,
          self.surrogates_default_params[surrogate],
          model.use_input_preprocessing,
      )
  
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 1 to create a new SurrogateExplainer object from inherited base classes: Explainer with example: obj = SurrogateExplainer(model, surrogate)