code: def add_computational_primitive_features(
      df, add_types=[], idcolumn=""
  ):
      """
      ###   Modify Dataframe by adding computational primitive Features using Feature Tools ####
      ###   What are computational primitives? they are to add, subtract, multiply and divide features
      ### Inputs:
      ###   df: Just sent in the data frame df that you want features added to
      ###   add_types: list of computational types: 'add', 'subtract', 'multiply' and 'divide'. Choose any or all.
      ###   idcolumn: this is to create an index for the dataframe since FT runs on index variable. You can leave it empty string.
      """
      try:
          import featuretools as ft
      except:
          print(
              "You must install featuretools to use feature_engineering functions. Install it and try again."
          )
      df = copy.deepcopy(df)
      projectid = "project_prediction"
      dataid = "project_data"
      if idcolumn == "":
          indexid = "index"
          make_index = True
      else:
          indexid = idcolumn
          make_index = False
      # Make an entityset and add the entity
      es = ft.EntitySet(id=projectid)
      es.entity_from_dataframe(
          entity_id=dataid,
          dataframe=df,
          make_index=make_index,
          index=indexid,
      )
  
      # Run deep feature synthesis with given input primitives or automatically deep 2
      if len(add_types) > 0:
          ### Build Features based on given primitive types, add_types which is a list
          df_mod, feature_defs = ft.dfs(
              entityset=es,
              target_entity=dataid,
              trans_primitives=add_types,
          )
      else:
          ### Perform Deep Feature Synthesis Automatically for Depth 2
          df_mod, feature_defs = ft.dfs(
              entityset=es,
              target_entity=dataid,
              max_depth=2,
              n_jobs=-1,
              verbose=0,
          )
      if make_index:
          df_mod = df_mod.reset_index(drop=True)
      return df_mod
  
file_path: Auto_ViML/autoviml/feature_engineering.py
imports: import pandas
  import numpy
  import copy
  import time
  import pdb
label_desc: Use image node_id 1 for calling a global function with example usage: add_computational_primitive_features(df, add_types, idcolumn) and returns: df_mod