code: def get_decisiontree_summary_df(
      decisiontree_df, classifier=False, round=2, units=""
  ):
      """generate a pd.DataFrame with a more readable summary of a dataframe
      generated with get_decisiontree_df(...)
  
      Args:
          decisiontree_df (pd.DataFrame): dataframe generated with get_decisiontree_df(...)
          classifier (bool, optional): model is a classifier. Defaults to False.
          round (int, optional): Rounding to apply to floats. Defaults to 2.
          units (str, optional): units of target to display. Defaults to "".
  
      Returns:
          pd.DataFrame: columns=['Feature', 'Condition', 'Adjustment', 'New Prediction']
      """
      if classifier:
          base_value = np.round(
              100 * decisiontree_df.iloc[[0]]["average"].item(), round
          )
          prediction = np.round(
              100
              * (
                  decisiontree_df.iloc[[-1]]["average"].item()
                  + decisiontree_df.iloc[[-1]]["diff"].item()
              ),
              round,
          )
      else:
          base_value = np.round(
              decisiontree_df.iloc[[0]]["average"].item(), round
          )
          prediction = np.round(
              decisiontree_df.iloc[[-1]]["average"].item()
              + decisiontree_df.iloc[[-1]]["diff"].item(),
              round,
          )
  
      decisiontree_summary_df = pd.DataFrame(
          columns=[
              "Feature",
              "Condition",
              "Adjustment",
              "New Prediction",
          ]
      )
      decisiontree_summary_df = append_dict_to_df(
          decisiontree_summary_df,
          {
              "Feature": "",
              "Condition": "",
              "Adjustment": "Starting average",
              "New Prediction": str(np.round(base_value, round))
              + ("%" if classifier else f" {units}"),
          },
      )
  
      for _, row in decisiontree_df.iterrows():
          if classifier:
              decisiontree_summary_df = append_dict_to_df(
                  decisiontree_summary_df,
                  {
                      "Feature": row["feature"],
                      "Condition": str(row["value"])
                      + str(
                          " >= "
                          if row["direction"] == "right"
                          else " < "
                      )
                      + str(row["split"]).ljust(10),
                      "Adjustment": str("+" if row["diff"] >= 0 else "")
                      + str(np.round(100 * row["diff"], round))
                      + "%",
                      "New Prediction": str(
                          np.round(
                              100 * (row["average"] + row["diff"]),
                              round,
                          )
                      )
                      + "%",
                  },
              )
          else:
              decisiontree_summary_df = append_dict_to_df(
                  decisiontree_summary_df,
                  {
                      "Feature": row["feature"],
                      "Condition": str(row["value"])
                      + str(
                          " >= "
                          if row["direction"] == "right"
                          else " < "
                      )
                      + str(row["split"]).ljust(10),
                      "Adjustment": str("+" if row["diff"] >= 0 else "")
                      + str(np.round(row["diff"], round)),
                      "New Prediction": str(
                          np.round(
                              (row["average"] + row["diff"]), round
                          )
                      )
                      + f" {units}",
                  },
              )
  
      decisiontree_summary_df = append_dict_to_df(
          decisiontree_summary_df,
          {
              "Feature": "",
              "Condition": "",
              "Adjustment": "Final Prediction",
              "New Prediction": str(np.round(prediction, round))
              + ("%" if classifier else "")
              + f" {units}",
          },
      )
  
      return decisiontree_summary_df
  
imports: from functools import partial
  import re
  from collections import Counter
  from typing import List, Union
  import warnings
  import numpy
  import pandas
  from pandas.api.types import is_numeric_dtype, is_categorical_dtype
  from dtreeviz.trees import ShadowDecTree
  from sklearn.metrics import make_scorer
  from sklearn.base import clone
  from sklearn.pipeline import Pipeline
  from sklearn.model_selection import KFold, StratifiedKFold
  from joblib import Parallel, delayed
label_desc: Use image node_id 28 for calling a global function with example usage: get_decisiontree_summary_df(decisiontree_df, classifier, round, units) and returns: decisiontree_summary_df