code: def __init__(self, tree, normalize=False):
      if str(type(tree)).endswith("'sklearn.tree._tree.Tree'>"):
          self.children_left = tree.children_left.astype(np.int32)
          self.children_right = tree.children_right.astype(np.int32)
          self.children_default = (
              self.children_left
          )  # missing values not supported in sklearn
          self.features = tree.feature.astype(np.int32)
          self.thresholds = tree.threshold.astype(np.float64)
          if normalize:
              self.values = (
                  tree.value[:, 0, :].T / tree.value[:, 0, :].sum(1)
              ).T
          else:
              self.values = tree.value[:, 0, :]
  
          self.node_sample_weight = tree.weighted_n_node_samples.astype(
              np.float64
          )
  
          # we recompute the expectations to make sure they follow the SHAP logic
          self.max_depth = compute_expectations(
              self.children_left,
              self.children_right,
              self.node_sample_weight,
              self.values,
              0,
          )
  
file_path: shap/shap/explainers/pytree.py
imports: import numpy
  import pandas
  from ..utils._exceptions import ExplainerError
label_desc: Use image node_id 1 to create a new Tree object  with example: obj = Tree(tree, normalize)