code: def main(readcsv=pd_read_csv):
      nFeatures = 3
      nClasses = 5
      maxIterations = 100
      minObservationsInLeafNode = 8
      # 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.gbt_classification_training(
          nClasses=nClasses,
          maxIterations=maxIterations,
          minObservationsInLeafNode=minObservationsInLeafNode,
          featuresPerNode=nFeatures,
          varImportance="weight|totalCover|cover|totalGain|gain",
      )
  
      # 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)
  
      # Now let's do some prediction
      # previous version has different interface
      predict_algo = d4p.gbt_classification_prediction(
          nClasses=nClasses,
          resultsToEvaluate="computeClassLabels|computeClassProbabilities",
      )
      # read test data (with same #features)
      pdata = readcsv(testfile, usecols=range(3), 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
      plabels = readcsv(testfile, range(3, 4), dtype=np.float32)
      assert (
          np.count_nonzero(predict_result.prediction - plabels)
          / pdata.shape[0]
          < 0.023
      )
  
      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) and returns: train_result,  predict_result,  plabels