class_docstr: Gradient boosting for classification. Gradient boosting method creates an ensemble of decision trees
  using random subsets of features and input data.
  
  :param loss: the loss function to be optimized. 
      'binomial' refers to deviance (= logistic regression) for classification
      with probabilistic outputs. 
      'exponential' is similar to the AdaBoost algorithm.
  :type loss: str, {'exponential', 'binomial', 'squared_hinge', 'l2'}, default='binomial'
  
  :param iteration_count: the maximum number of iterations (that is, the number of trees in the ensemble).
  :type iteration_count: int, default=100
  
  :param learning_rate: the multiplier for each classifier tree.
      There is a trade-off between ``learning_rate`` and ``iteration_count``.
  :type learning_rate: float, default=0.1
  
  :param subsample: the fraction of input data that is used for building one tree.
  :type subsample: float, [0..1], default=1.0
  
  :param subfeature: the fraction of features that is used for building one tree.
  :type subfeature: float, [0..1], default=1.0
  
  :param random_seed: the random generator seed number.
  :type random_seed: int, default=0
  
  :param max_depth: the maximum depth of a tree in ensemble.
  :type max_depth: int, default=10
  
  :param max_node_count: the maximum number of nodes in a tree. -1 means no limitation.
  :type max_node_count: int, default=-1
  
  :param l1_reg: the L1 regularization factor.
  :type l1_reg: float, default=0.0
  
  :param l2_reg: the L2 regularization factor.
  :type l2_reg: float, default=1.0
  
  :param prune: the value of criterion difference when the nodes should be merged.
      The 0 default value means never merge nodes.
  :type prune: float, default=0.0
  
  :param thread_count: the number of processing threads to be used while training the model.
  :type thread_count: int, default=1
  
  :param builder_type: the type of tree builder used. 
      ``full`` means all feature values are used for splitting nodes.
      ``hist`` means the steps of a histogram created from feature values
      ``multi_full`` means 'full' with multiclass trees
      will be used for splitting nodes.
  :type builder_type: str, {'full', 'hist', 'multi_full'}, default='full'
  
  :param max_bins: the largest possible histogram size to be used in ``hist`` mode.
  :type max_bins: int, default=32
  
  :param min_subtree_weight: the minimum subtree weight. The 0 default value means no lower limit.
  :type min_subtree_weight: float, default=0.0
class_docstr_tok: ["Gradient","boosting","for","classification",".","Gradient","boosting","method","creates","an","ensemble","of","decision","trees","using","random","subsets","of","features","and","input","data",".",":","param","loss",":","the","loss","function","to","be","optimized",".","'binomial","'","refers","to","deviance","(","=","logistic","regression",")","for","classification","with","probabilistic","outputs",".","'exponential","'","is","similar","to","the","AdaBoost","algorithm",".",":","type","loss",":","str",",","{","'exponential","'",",","'binomial","'",",","'squared_hinge","'",",","'l2","'","}",",","default='binomial'",":","param","iteration_count",":","the","maximum","number","of","iterations","(","that","is",",","the","number","of","trees","in","the","ensemble",")",".",":","type","iteration_count",":","int",",","default=100",":","param","learning_rate",":","the","multiplier","for","each","classifier","tree",".","There","is","a","trade-off","between","``","learning_rate","``","and","``","iteration_count","``",".",":","type","learning_rate",":","float",",","default=0.1",":","param","subsample",":","the","fraction","of","input","data","that","is","used","for","building","one","tree",".",":","type","subsample",":","float",",","[","0","..","1","]",",","default=1.0",":","param","subfeature",":","the","fraction","of","features","that","is","used","for","building","one","tree",".",":","type","subfeature",":","float",",","[","0","..","1","]",",","default=1.0",":","param","random_seed",":","the","random","generator","seed","number",".",":","type","random_seed",":","int",",","default=0",":","param","max_depth",":","the","maximum","depth","of","a","tree","in","ensemble",".",":","type","max_depth",":","int",",","default=10",":","param","max_node_count",":","the","maximum","number","of","nodes","in","a","tree",".","-1","means","no","limitation",".",":","type","max_node_count",":","int",",","default=-1",":","param","l1_reg",":","the","L1","regularization","factor",".",":","type","l1_reg",":","float",",","default=0.0",":","param","l2_reg",":","the","L2","regularization","factor",".",":","type","l2_reg",":","float",",","default=1.0",":","param","prune",":","the","value","of","criterion","difference","when","the","nodes","should","be","merged",".","The","0","default","value","means","never","merge","nodes",".",":","type","prune",":","float",",","default=0.0",":","param","thread_count",":","the","number","of","processing","threads","to","be","used","while","training","the","model",".",":","type","thread_count",":","int",",","default=1",":","param","builder_type",":","the","type","of","tree","builder","used",".","``","full","``","means","all","feature","values","are","used","for","splitting","nodes",".","``","hist","``","means","the","steps","of","a","histogram","created","from","feature","values","``","multi_full","``","means","'full","'","with","multiclass","trees","will","be","used","for","splitting","nodes",".",":","type","builder_type",":","str",",","{","'full","'",",","'hist","'",",","'multi_full","'","}",",","default='full'",":","param","max_bins",":","the","largest","possible","histogram","size","to","be","used","in","``","hist","``","mode",".",":","type","max_bins",":","int",",","default=32",":","param","min_subtree_weight",":","the","minimum","subtree","weight",".","The","0","default","value","means","no","lower","limit",".",":","type","min_subtree_weight",":","float",",","default=0.0"]
docstr: Trains the gradient boosting model for classification.
  
  :param X: the training sample. The values will be converted 
      to ``dtype=np.float32``. If a sparse matrix is
      passed in, it will be converted to a sparse ``csr_matrix``.
  :type X: {array-like, sparse matrix} of shape (n_samples, n_features)
  
  :param Y: correct class labels (``int``) for the training set vectors.
  :type Y: array-like of shape (n_samples,)
  
  :param weight: sample weights. If None, then samples are equally weighted.
  :type weight: array-like of shape (n_samples,), default=None
  
  :return: the trained classification model.
  :rtype: neoml.GradientBoost.GradientBoostClassificationModel
docstr_tok: ["Trains","the","gradient","boosting","model","for","classification",".",":","param","X",":","the","training","sample",".","The","values","will","be","converted","to","``","dtype=np.float32","``",".","If","a","sparse","matrix","is","passed","in",",","it","will","be","converted","to","a","sparse","``","csr_matrix","``",".",":","type","X",":","{","array-like",",","sparse","matrix","}","of","shape","(","n_samples",",","n_features",")",":","param","Y",":","correct","class","labels","(","``","int","``",")","for","the","training","set","vectors",".",":","type","Y",":","array-like","of","shape","(","n_samples",",",")",":","param","weight",":","sample","weights",".","If","None",",","then","samples","are","equally","weighted",".",":","type","weight",":","array-like","of","shape","(","n_samples",",",")",",","default=None",":","return",":","the","trained","classification","model",".",":","rtype",":","neoml.GradientBoost.GradientBoostClassificationModel"]
code: def train(self, X, Y, weight=None):
      """Trains the gradient boosting model for classification.
  
      :param X: the training sample. The values will be converted
          to ``dtype=np.float32``. If a sparse matrix is
          passed in, it will be converted to a sparse ``csr_matrix``.
      :type X: {array-like, sparse matrix} of shape (n_samples, n_features)
  
      :param Y: correct class labels (``int``) for the training set vectors.
      :type Y: array-like of shape (n_samples,)
  
      :param weight: sample weights. If None, then samples are equally weighted.
      :type weight: array-like of shape (n_samples,), default=None
  
      :return: the trained classification model.
      :rtype: neoml.GradientBoost.GradientBoostClassificationModel
      """
      x = convert_data(X)
      y = numpy.array(Y, dtype=numpy.int32, copy=False, order="C")
  
      if x.shape[0] != y.size:
          raise ValueError(
              "The `X` and `Y` inputs must be the same length."
          )
  
      if weight is None:
          weight = numpy.ones(y.size, numpy.float32, order="C")
      else:
          weight = numpy.array(
              weight, dtype=numpy.float32, copy=False, order="C"
          )
  
      if numpy.any(y < 0):
          raise ValueError("All `Y` elements must be >= 0.")
  
      if numpy.any(weight < 0):
          raise ValueError("All `weight` elements must be >= 0.")
  
      return GradientBoostClassificationModel(
          super().train_classifier(
              *get_data(x), int(x.shape[1]), y, weight
          )
      )
  
file_path: neoml/NeoML/Python/neoml/GradientBoost.py
imports: import numpy
  from .Utils import convert_data, get_data
  import neoml.PythonWrapper
label_desc: Use image node_id 2 for calling the GradientBoostClassifier obj's underlying member method code with example usage: obj.train(X, Y, weight) and returns: GradientBoostClassificationModel