code: def main(readcsv=pd_read_csv, method="defaultDense"):
      data_path = Path(__file__).parent / "data" / "batch"
      infile = data_path / "df_regression_train.csv"
      testfile = data_path / "df_regression_test.csv"
  
      # Configure a Decision Forest regression training object
      train_algo = d4p.decision_forest_regression_training(
          method=method,
          nTrees=100,
          varImportance="MDA_Raw",
          bootstrap=True,
          engine=d4p.engines_mt2203(seed=777),
          resultsToCompute="computeOutOfBagError|computeOutOfBagErrorPerObservation",
      )
  
      # Read data. Let's have 13 independent,
      # and 1 dependent variables (for each observation)
      indep_data = readcsv(infile, usecols=range(13), dtype=np.float32)
      dep_data = readcsv(
          infile, usecols=range(13, 14), dtype=np.float32
      )
      # Now train/compute, the result provides the model for prediction
      train_result = train_algo.compute(indep_data, dep_data)
      # Traiing result provides (depending on parameters) model,
      # outOfBagError, outOfBagErrorPerObservation and/or variableImportance
  
      # Now let's do some prediction
      predict_algo = d4p.decision_forest_regression_prediction()
      # read test data (with same #features)
      pdata = readcsv(testfile, usecols=range(13), dtype=np.float32)
      ptdata = readcsv(
          testfile, usecols=range(13, 14), dtype=np.float32
      )
      # now predict using the model from the training above
      predict_result = predict_algo.compute(pdata, train_result.model)
  
      # The prediction result provides prediction
      assert predict_result.prediction.shape == (
          pdata.shape[0],
          dep_data.shape[1],
      )
  
      return (train_result, predict_result, ptdata)
  
imports: from pathlib import Path
  import numpy
  from readcsv import pd_read_csv
  import daal4py
label_desc: Use image node_id 1 for calling a global function with example usage: main(readcsv, method) and returns: train_result,  predict_result,  ptdata