class_docstr: Decision tree classifier.
  
  :param criterion: the type of criterion to be used for subtree splitting.
  :type criterion: str, {'gini', 'information_gain'}, default='gini'
  
  :param min_subset_size: the minimum number of vectors corresponding to a node subtree.
  :type min_subset_size: int, default=1
  
  :param min_subset_part: the minimum weight of the vectors in a subtree relative to the parent node weight.
  :type min_subset_part: float, [0..1], default=0.0
  
  :param min_split_size: the minimum number of vectors in a node subtree when it may be divided further.
  :type min_split_size: int, default=1
  
  :param max_tree_depth: the maximum depth of the tree.
  :type max_tree_depth: int, default=32
  
  :param max_node_count: the maximum number of nodes in the tree.
  :type max_node_count: int, default=4096
  
  :param const_threshold: if the ratio of same class elements in the subset is greater than this value,
      a constant node will be created.
  :type const_threshold: float, [0..1], default=0.99
  
  :param random_selected_feature_count: no more than this number of randomly selected features will be used for each node.
      -1 means use all features every time.
  :type random_selected_feature_count: int, default=-1
  
  :param available_memory: the memory limit for the algorithm (default is 1 Gigabyte)
  :type available_memory: int, default=1024*1024*1024
  
  :param multiclass_mode: determines how to handle multi-class classification
  :type multiclass_mode: str, ['single_tree', 'one_vs_all', 'one_vs_one'], default='single_tree'
docstr: Trains the decision tree.
  
  :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.DecisionTree.DecisionTreeClassificationModel
docstr_tok: ["Trains","the","decision","tree",".",":","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.DecisionTree.DecisionTreeClassificationModel"]
code: def train(self, X, Y, weight=None):
      """Trains the decision tree.
  
      :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.DecisionTree.DecisionTreeClassificationModel
      """
  
      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 DecisionTreeClassificationModel(
          super().train_classifier(
              *get_data(x), int(x.shape[1]), y, weight
          )
      )
  
file_path: neoml/NeoML/Python/neoml/DecisionTree.py
imports: import numpy
  from .Utils import convert_data, get_data
  from scipy.sparse import csr_matrix, issparse
  import neoml.PythonWrapper
label_desc: Use image node_id 2 for calling the DecisionTreeClassifier obj's underlying member method code with example usage: obj.train(X, Y, weight) and returns: DecisionTreeClassificationModel