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)
  
      if not callable(self.kernel):
          X = self._validate_data(
              X,
              accept_sparse="csr",
              dtype=np.float64,
              order="C",
              accept_large_sparse=False,
              reset=False,
          )
  
      if self._sparse and not sp.issparse(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__
          )
  
      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])
              )
      # Fixes https://nvd.nist.gov/vuln/detail/CVE-2020-28975
      # Check that _n_support is consistent with support_vectors
      sv = self.support_vectors_
      if (
          not self._sparse
          and sv.size > 0
          and self.n_support_.sum() != sv.shape[0]
      ):
          raise ValueError(
              f"The internal representation of {self.__class__.__name__} was altered"
          )
      return X
  
imports: import warnings
  from abc import ABCMeta, abstractmethod
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from ..base import BaseEstimator, ClassifierMixin, _fit_context
  from ..exceptions import ConvergenceWarning, NotFittedError
  from ..preprocessing import LabelEncoder
  from ..utils import check_array, check_random_state, column_or_1d, compute_class_weight
  from ..utils._param_validation import Interval, StrOptions
  from ..utils.extmath import safe_sparse_dot
  from ..utils.metaestimators import available_if
  from ..utils.multiclass import _ovr_decision_function, check_classification_targets
  from ..utils.validation import _check_large_sparse, _check_sample_weight, _num_samples, check_consistent_length, check_is_fitted
  from .None import _liblinear
  from .None import _libsvm
  from .None import _libsvm_sparse
label_desc: Use image node_id 15 for calling the BaseLibSVM obj's underlying member method code with example usage: obj._validate_for_predict(X) and returns: X