class_docstr: Learning algorithm for a gradient boosted trees model for
  classification or regression.
  
  .. versionadded:: 1.3.0
class_docstr_tok: ["Learning","algorithm","for","a","gradient","boosted","trees","model","for","classification","or","regression",".","..","versionadded",":",":","1.3.0"]
code: def _train(
      cls,
      data: RDD[LabeledPoint],
      algo: str,
      categoricalFeaturesInfo: Dict[int, int],
      loss: str,
      numIterations: int,
      learningRate: float,
      maxDepth: int,
      maxBins: int,
  ) -> GradientBoostedTreesModel:
      first = data.first()
      assert isinstance(
          first, LabeledPoint
      ), "the data should be RDD of LabeledPoint"
      model = callMLlibFunc(
          "trainGradientBoostedTreesModel",
          data,
          algo,
          categoricalFeaturesInfo,
          loss,
          numIterations,
          learningRate,
          maxDepth,
          maxBins,
      )
      return GradientBoostedTreesModel(model)
  
imports: import sys
  import random
  from pyspark import RDD, since
  from pyspark.mllib.common import callMLlibFunc, inherit_doc, JavaModelWrapper
  from pyspark.mllib.linalg import _convert_to_vector
  from pyspark.mllib.regression import LabeledPoint
  from pyspark.mllib.util import JavaLoader, JavaSaveable
  from typing import Dict, Optional, Tuple, Union, overload, TYPE_CHECKING
  from pyspark.rdd import RDD
label_desc: Use image node_id 1 for calling the GradientBoostedTrees obj's underlying member method code with example usage: obj._train(cls, data, algo, categoricalFeaturesInfo, loss, numIterations, learningRate, maxDepth, maxBins) and returns: GradientBoostedTreesModel