code: def decision_tree_disc(df, cols, depth=4):
      for col in cols:
          df[col + "_m1"] = df[col].shift(1)
          df = df.iloc[1:, :]
          tree_model = DecisionTreeRegressor(
              max_depth=depth, random_state=0
          )
          tree_model.fit(df[col + "_m1"].to_frame(), df[col])
          df[col + "_Disc"] = tree_model.predict(
              df[col + "_m1"].to_frame()
          )
      return df
  
file_path: deltapy/deltapy/interact.py
imports: import numpy
  import pandas
  from statsmodels.tsa.ar_model import AR
  from timeit import default_timer
  from sklearn.tree import DecisionTreeRegressor
  from math import sin, cos, sqrt, atan2, radians, ceil
  import ta
  from gplearn.genetic import SymbolicTransformer
  from scipy import linalg
  import math
label_desc: Use image node_id 4 for calling a global function with example usage: decision_tree_disc(df, cols, depth) and returns: df