class_docstr: Base class for decision trees.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
class_docstr_tok: ["Base","class","for","decision","trees",".","Warning",":","This","class","should","not","be","used","directly",".","Use","derived","classes","instead","."]
docstr: Predict class or regression value for X.
  
  For a classification model, the predicted class for each sample in X is
  returned. For a regression model, the predicted value based on X is
  returned.
  
  Parameters
  ----------
  X : {array-like, sparse matrix} of shape (n_samples, n_features)
      The input samples. Internally, it will be converted to
      ``dtype=np.float32`` and if a sparse matrix is provided
      to a sparse ``csr_matrix``.
  
  check_input : bool, default=True
      Allow to bypass several input checking.
      Don't use this parameter unless you know what you do.
  
  Returns
  -------
  y : array-like of shape (n_samples,) or (n_samples, n_outputs)
      The predicted classes, or the predict values.
docstr_tok: ["Predict","class","or","regression","value","for","X",".","For","a","classification","model",",","the","predicted","class","for","each","sample","in","X","is","returned",".","For","a","regression","model",",","the","predicted","value","based","on","X","is","returned",".","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix","}","of","shape","(","n_samples",",","n_features",")","The","input","samples",".","Internally",",","it","will","be","converted","to","``","dtype=np.float32","``","and","if","a","sparse","matrix","is","provided","to","a","sparse","``","csr_matrix","``",".","check_input",":","bool",",","default=True","Allow","to","bypass","several","input","checking",".","Do","n't","use","this","parameter","unless","you","know","what","you","do",".","Returns","--","--","--","-","y",":","array-like","of","shape","(","n_samples",",",")","or","(","n_samples",",","n_outputs",")","The","predicted","classes",",","or","the","predict","values","."]
code: def predict(self, X, check_input=True):
      """Predict class or regression value for X.
  
      For a classification model, the predicted class for each sample in X is
      returned. For a regression model, the predicted value based on X is
      returned.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples, n_features)
          The input samples. Internally, it will be converted to
          ``dtype=np.float32`` and if a sparse matrix is provided
          to a sparse ``csr_matrix``.
  
      check_input : bool, default=True
          Allow to bypass several input checking.
          Don't use this parameter unless you know what you do.
  
      Returns
      -------
      y : array-like of shape (n_samples,) or (n_samples, n_outputs)
          The predicted classes, or the predict values.
      """
      check_is_fitted(self)
      X = self._validate_X_predict(X, check_input)
      proba = self.tree_.predict(X)
      n_samples = X.shape[0]
  
      # Classification
      if is_classifier(self):
          if self.n_outputs_ == 1:
              return self.classes_.take(
                  np.argmax(proba, axis=1), axis=0
              )
  
          else:
              class_type = self.classes_[0].dtype
              predictions = np.zeros(
                  (n_samples, self.n_outputs_), dtype=class_type
              )
              for k in range(self.n_outputs_):
                  predictions[:, k] = self.classes_[k].take(
                      np.argmax(proba[:, k], axis=1), axis=0
                  )
  
              return predictions
  
      # Regression
      else:
          if self.n_outputs_ == 1:
              return proba[:, 0]
  
          else:
              return proba[:, :, 0]
  
imports: from abc import ABCMeta
  from abc import abstractmethod
  from sklearn.base import MultiOutputMixin
  from sklearn.base import BaseEstimator
  from sklearn.base import is_classifier, clone
  from sklearn.utils import Bunch
  from sklearn.utils.validation import check_is_fitted
  import numpy
  from scipy.sparse import issparse
  from ._tree import Tree
  from ._tree import _build_pruned_tree_ccp
  from ._tree import ccp_pruning_path
  from .None import _tree, _splitter
label_desc: Use image node_id 6 for calling the BaseDecisionTree obj's underlying member method code with example usage: obj.predict(X, check_input) and returns: self, predictions, proba, proba