class_docstr: Base class for estimators that use libsvm as backing library
  
  This implements support vector machine classification and regression.
  
  Parameter documentation is in the derived `SVC` class.
class_docstr_tok: ["Base","class","for","estimators","that","use","libsvm","as","backing","library","This","implements","support","vector","machine","classification","and","regression",".","Parameter","documentation","is","in","the","derived","`","SVC","`","class","."]
code: def _validate_for_predict(self, X):
      check_is_fitted(self, "support_")
  
      X = check_array(
          X, accept_sparse="csr", dtype=np.float64, order="C"
      )
      if self._sparse and not sp.isspmatrix(X):
          X = sp.csr_matrix(X)
      if self._sparse:
          X.sort_indices()
  
      if (
          sp.issparse(X)
          and not self._sparse
          and not callable(self.kernel)
      ):
          raise ValueError(
              "cannot use sparse input in %r trained on dense data"
              % type(self).__name__
          )
      n_samples, n_features = X.shape
  
      if self.kernel == "precomputed":
          if X.shape[1] != self.shape_fit_[0]:
              raise ValueError(
                  "X.shape[1] = %d should be equal to %d, "
                  "the number of samples at training time"
                  % (X.shape[1], self.shape_fit_[0])
              )
      elif n_features != self.shape_fit_[1]:
          raise ValueError(
              "X.shape[1] = %d should be equal to %d, "
              "the number of features at training time"
              % (n_features, self.shape_fit_[1])
          )
      return X
  
imports: from __future__ import print_function
  import numpy
  import scipy.sparse
  import warnings
  from abc import ABCMeta, abstractmethod
  from .None import libsvm, liblinear
  from .None import libsvm_sparse
  from ..base import BaseEstimator, ClassifierMixin
  from ..preprocessing import LabelEncoder
  from ..utils.multiclass import _ovr_decision_function
  from ..utils import check_array, check_consistent_length, check_random_state
  from ..utils import column_or_1d, check_X_y
  from ..utils import compute_class_weight, deprecated
  from ..utils.extmath import safe_sparse_dot
  from ..utils.validation import check_is_fitted
  from ..utils.multiclass import check_classification_targets
  from ..externals import six
  from ..exceptions import ChangedBehaviorWarning
  from ..exceptions import ConvergenceWarning
  from ..exceptions import NotFittedError
label_desc: Use image node_id 16 for calling the BaseLibSVM obj's underlying member method code with example usage: obj._validate_for_predict(X) and returns: X