class_docstr: This object adapts decision trees constructed by the various libraries such as scikit-learn's and XGBoost's
  DecisionTree(Regressor|Classifier) to dtreeviz.  As part of the construction process, the samples
  considered at decision and leaf nodes are saved as a big dictionary for use by the nodes.
  
  The decision trees for classifiers and regressors from scikit-learn and
  XGBoost etc... are built for efficiency, not ease of tree walking. This class
  wraps all of that information in an easy-to-use and consistent interface
  that hides the details of the various decision tree libraries.
  
  Field leaves is list of shadow leaf nodes.
  Field internal is list of shadow non-leaf nodes.
  Field root is the shadow tree root.
class_docstr_tok: ["This","object","adapts","decision","trees","constructed","by","the","various","libraries","such","as","scikit-learn","'s","and","XGBoost's","DecisionTree","(","Regressor|Classifier",")","to","dtreeviz",".","As","part","of","the","construction","process",",","the","samples","considered","at","decision","and","leaf","nodes","are","saved","as","a","big","dictionary","for","use","by","the","nodes",".","The","decision","trees","for","classifiers","and","regressors","from","scikit-learn","and","XGBoost","etc","...","are","built","for","efficiency",",","not","ease","of","tree","walking",".","This","class","wraps","all","of","that","information","in","an","easy-to-use","and","consistent","interface","that","hides","the","details","of","the","various","decision","tree","libraries",".","Field","leaves","is","list","of","shadow","leaf","nodes",".","Field","internal","is","list","of","shadow","non-leaf","nodes",".","Field","root","is","the","shadow","tree","root","."]
docstr: Parameters
  ----------
  :param tree_model: sklearn.tree.DecisionTreeRegressor, sklearn.tree.DecisionTreeClassifier, xgboost.core.Booster
      The decision tree to be interpreted
  :param X_train: pd.DataFrame, np.ndarray
      Features values on which the shadow tree will be build.
  :param y_train: pd.Series, np.ndarray
      Target values on which the shadow tree will be build.
  :param feature_names: List[str]
      Features' names
  :param target_name: str
      Target's name
  :param class_names: List[str], Mapping[int, str]
      Class' names (in case of a classifier)
docstr_tok: ["Parameters","--","--","--","--","--",":","param","tree_model",":","sklearn.tree.DecisionTreeRegressor",",","sklearn.tree.DecisionTreeClassifier",",","xgboost.core.Booster","The","decision","tree","to","be","interpreted",":","param","X_train",":","pd.DataFrame",",","np.ndarray","Features","values","on","which","the","shadow","tree","will","be","build",".",":","param","y_train",":","pd.Series",",","np.ndarray","Target","values","on","which","the","shadow","tree","will","be","build",".",":","param","feature_names",":","List","[","str","]","Features","'","names",":","param","target_name",":","str","Target","'s","name",":","param","class_names",":","List","[","str","]",",","Mapping","[","int",",","str","]","Class","'","names","(","in","case","of","a","classifier",")"]
code: def __init__(
      self,
      tree_model,
      X_train: (pd.DataFrame, np.ndarray),
      y_train: (pd.Series, np.ndarray),
      feature_names: List[str] = None,
      target_name: str = None,
      class_names: (List[str], Mapping[int, str]) = None,
  ):
      """
      Parameters
      ----------
      :param tree_model: sklearn.tree.DecisionTreeRegressor, sklearn.tree.DecisionTreeClassifier, xgboost.core.Booster
          The decision tree to be interpreted
      :param X_train: pd.DataFrame, np.ndarray
          Features values on which the shadow tree will be build.
      :param y_train: pd.Series, np.ndarray
          Target values on which the shadow tree will be build.
      :param feature_names: List[str]
          Features' names
      :param target_name: str
          Target's name
      :param class_names: List[str], Mapping[int, str]
          Class' names (in case of a classifier)
  
      """
  
      self.tree_model = tree_model
      if not self.is_fit():
          raise Exception(f"Model {tree_model} is not fit.")
  
      self.feature_names = feature_names
      self.target_name = target_name
      self.X_train = ShadowDecTree._get_x_data(X_train)
      self.y_train = ShadowDecTree._get_y_data(y_train)
      self.root, self.leaves, self.internal = self._get_tree_nodes()
      if self.is_classifier():
          self.class_names = utils._normalize_class_names(
              class_names, self.nclasses()
          )
  
imports: from abc import ABC, abstractmethod
  from numbers import Number
  from typing import List, Tuple, Mapping
  import numpy
  import pandas
  import sklearn
  from dtreeviz import utils
label_desc: Use image node_id 1 to create a new ShadowDecTree object from inherited base classes: ABC with example: obj = ShadowDecTree(tree_model, X_train, y_train, feature_names, target_name, class_names)