parameters: (self, X, check_input)
return_statement: return X
docstring: Validate X whenever one tries to predict, apply, predict_proba
docstring_summary: Validate X whenever one tries to predict, apply, predict_proba
docstring_tokens: Validate X whenever one tries to predict apply predict_proba
function: def _validate_X_predict(self, X, check_input):
          """Validate X whenever one tries to predict, apply, predict_proba"""
          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
function_tokens: def _validate_X_predict ( self , X , check_input ) : 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