code: def test_XGBRegressor(self):
      from sys import platform
  
      if platform in ("darwin", "win32"):
          return
  
      if self.sc.version.startswith(
          "3.1"
      ) or self.sc.version.startswith("2.4"):
          data = self.sc.parallelize(
              [
                  (
                      1.0,
                      2.0,
                      3.0,
                      4.0,
                      5.0,
                      1.0,
                      2.0,
                      4.0,
                      8.0,
                      3.0,
                      116.3668,
                  ),
                  (
                      1.0,
                      3.0,
                      8.0,
                      6.0,
                      5.0,
                      9.0,
                      5.0,
                      6.0,
                      7.0,
                      4.0,
                      116.367,
                  ),
                  (
                      2.0,
                      1.0,
                      5.0,
                      7.0,
                      6.0,
                      7.0,
                      4.0,
                      1.0,
                      2.0,
                      3.0,
                      116.367,
                  ),
                  (
                      2.0,
                      1.0,
                      4.0,
                      3.0,
                      6.0,
                      1.0,
                      3.0,
                      2.0,
                      1.0,
                      3.0,
                      116.3668,
                  ),
              ]
          )
          columns = [
              "f1",
              "f2",
              "f3",
              "f4",
              "f5",
              "f6",
              "f7",
              "f8",
              "f9",
              "f10",
              "label",
          ]
          df = data.toDF(columns)
          from pyspark.ml.feature import VectorAssembler
  
          vecasembler = VectorAssembler(
              inputCols=columns, outputCol="features"
          )
          assembledf = (
              vecasembler.transform(df)
              .select("features", "label")
              .cache()
          )
          assembledf.printSchema()
          testdf = (
              vecasembler.transform(df)
              .select("features", "label")
              .cache()
          )
          params = {"eta": 0.2, "max_depth": 4, "max_leaf_nodes": 8}
          xgbRf0 = XGBRegressor(params)
          xgbRf0.setNthread(1)
          xgbRf0.setNumRound(10)
          xgbmodel = xgbRf0.fit(assembledf)
          xgbmodel.save("/tmp/modelfile/")
          xgbmodel.setFeaturesCol("features")
          yxgb = xgbmodel.transform(assembledf)
          model = xgbmodel.load("/tmp/modelfile/")
          model.setFeaturesCol("features")
          y0 = model.transform(assembledf)
          assert y0.subtract(yxgb).count() == 0
  
file_path: BigDL/python/dllib/test/bigdl/nnframes/test_treemodel.py
imports: import pytest
  from bigdl.dllib.nncontext import *
  from bigdl.dllib.nnframes.tree_model import *
  from bigdl.dllib.utils.tf import *
  from pyspark.ml.linalg import DenseVector, VectorUDT
  from pyspark.sql.functions import udf, array
label_desc: Use image node_id 6 for calling the TestTreeModel obj's underlying member method code with example usage: obj.test_XGBRegressor() without return types