code: def main(readcsv=pd_read_csv, method="defaultDense"):
      # input data file
      data_path = Path(__file__).parent / "data" / "batch"
      infile = data_path / "df_classification_train.csv"
      testfile = data_path / "df_classification_test.csv"
  
      # Configure a training object (5 classes)
      train_algo = d4p.decision_forest_classification_training(
          5,
          method=method,
          nTrees=10,
          minObservationsInLeafNode=8,
          featuresPerNode=3,
          engine=d4p.engines_mt19937(seed=777),
          varImportance="MDI",
          bootstrap=True,
          resultsToCompute="computeOutOfBagError",
      )
  
      # Read data. Let's use 3 features per observation
      data = readcsv(infile, usecols=range(3), dtype=np.float32)
      labels = readcsv(infile, usecols=range(3, 4), dtype=np.float32)
      train_result = train_algo.compute(data, labels)
      # Traiing result provides (depending on parameters) model,
      # outOfBagError, outOfBagErrorPerObservation and/or variableImportance
  
      # Now let's do some prediction
      predict_algo = d4p.decision_forest_classification_prediction(
          nClasses=5,
          resultsToEvaluate="computeClassLabels|computeClassProbabilities",
          votingMethod="unweighted",
      )
      # read test data (with same #features)
      pdata = readcsv(testfile, usecols=range(3), dtype=np.float32)
      plabels = readcsv(testfile, usecols=range(3, 4), dtype=np.float32)
      # now predict using the model from the training above
      predict_result = predict_algo.compute(pdata, train_result.model)
  
      # Prediction result provides prediction
      assert predict_result.prediction.shape == (pdata.shape[0], 1)
  
      return (train_result, predict_result, plabels)
  
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,  plabels