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: Validate X whenever one tries to predict, apply, predict_proba
docstr_tok: ["Validate","X","whenever","one","tries","to","predict",",","apply",",","predict_proba"]
code: def _validate_X_predict(self, X, check_input):
      """Validate X whenever one tries to predict, apply, predict_proba"""
      if self.tree_ is None:
          raise NotFittedError(
              "Estimator not fitted, "
              "call `fit` before exploiting the model."
          )
  
      if check_input:
          X = check_array(X, dtype=DTYPE, accept_sparse="csr")
          if issparse(X) and (
              X.indices.dtype != np.intc or X.indptr.dtype != np.intc
          ):
              raise ValueError(
                  "No support for np.int64 index based "
                  "sparse matrices"
              )
  
      n_features = X.shape[1]
      if self.n_features_ != n_features:
          raise ValueError(
              "Number of features of the model must "
              "match the input. Model n_features is %s and "
              "input n_features is %s " % (self.n_features_, n_features)
          )
  
      return X
  
imports: from __future__ import division
  import numbers
  from abc import ABCMeta
  from abc import abstractmethod
  from math import ceil
  import numpy
  from scipy.sparse import issparse
  from ..base import BaseEstimator
  from ..base import ClassifierMixin
  from ..base import RegressorMixin
  from ..externals import six
  from ..feature_selection.from_model import _LearntSelectorMixin
  from ..utils import check_array
  from ..utils import check_random_state
  from ..utils import compute_sample_weight
  from ..utils.multiclass import check_classification_targets
  from ..exceptions import NotFittedError
  from ._criterion import Criterion
  from ._splitter import Splitter
  from ._tree import DepthFirstTreeBuilder
  from ._tree import BestFirstTreeBuilder
  from ._tree import Tree
  from .None import _tree, _splitter, _criterion
label_desc: Use image node_id 3 for calling the BaseDecisionTree obj's underlying member method code with example usage: obj._validate_X_predict(X, check_input) and returns: X