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 _sparse_fit(
      self, X, y, sample_weight, solver_type, kernel, random_seed
  ):
      X.data = np.asarray(X.data, dtype=np.float64, order="C")
      X.sort_indices()
  
      kernel_type = self._sparse_kernels.index(kernel)
  
      libsvm_sparse.set_verbosity_wrap(self.verbose)
  
      (
          self.support_,
          self.support_vectors_,
          dual_coef_data,
          self.intercept_,
          self._n_support,
          self._probA,
          self._probB,
          self.fit_status_,
          self._num_iter,
      ) = libsvm_sparse.libsvm_sparse_train(
          X.shape[1],
          X.data,
          X.indices,
          X.indptr,
          y,
          solver_type,
          kernel_type,
          self.degree,
          self._gamma,
          self.coef0,
          self.tol,
          self.C,
          getattr(self, "class_weight_", np.empty(0)),
          sample_weight,
          self.nu,
          self.cache_size,
          self.epsilon,
          int(self.shrinking),
          int(self.probability),
          self.max_iter,
          random_seed,
      )
  
      self._warn_from_fit_status()
  
      if hasattr(self, "classes_"):
          n_class = len(self.classes_) - 1
      else:  # regression
          n_class = 1
      n_SV = self.support_vectors_.shape[0]
  
      dual_coef_indices = np.tile(np.arange(n_SV), n_class)
      if not n_SV:
          self.dual_coef_ = sp.csr_matrix([])
      else:
          dual_coef_indptr = np.arange(
              0,
              dual_coef_indices.size + 1,
              dual_coef_indices.size / n_class,
          )
          self.dual_coef_ = sp.csr_matrix(
              (dual_coef_data, dual_coef_indices, dual_coef_indptr),
              (n_class, n_SV),
          )
  
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 7 for calling the BaseLibSVM obj's underlying member method code with example usage: obj._sparse_fit(X, y, sample_weight, solver_type, kernel, random_seed) without return types