code: def _sparse_fit(self, X, y, groups=None):
      X.data = np.asarray(X.data, dtype=np.float32, order="C")
      X.sort_indices()
      data = X.data.ctypes.data_as(POINTER(c_float))
      indices = X.indices.ctypes.data_as(POINTER(c_int32))
      indptr = X.indptr.ctypes.data_as(POINTER(c_int32))
      y = np.asarray(y, dtype=np.float32, order="C")
      label = y.ctypes.data_as(POINTER(c_float))
      in_groups, num_groups = self._construct_groups(groups)
      group_label = (c_float * len(set(y)))()
      n_class = (c_int * 1)()
      n_class[0] = self.num_class
      tree_per_iter_ptr = (c_int * 1)()
      self.model = (c_long * 1)()
      thundergbm.sparse_train_scikit(
          X.shape[0],
          data,
          indptr,
          indices,
          label,
          self.depth,
          self.n_trees,
          self.n_gpus,
          c_float(self.min_child_weight),
          c_float(self.lambda_tgbm),
          c_float(self.gamma),
          self.max_num_bin,
          self.verbose,
          c_float(self.column_sampling_rate),
          self.bagging,
          self.n_parallel_trees,
          c_float(self.learning_rate),
          self.objective.encode("utf-8"),
          n_class,
          self.tree_method.encode("utf-8"),
          byref(self.model),
          tree_per_iter_ptr,
          group_label,
          in_groups,
          num_groups,
      )
      self.num_class = n_class[0]
      self.tree_per_iter = tree_per_iter_ptr[0]
      self.group_label = [
          group_label[idx] for idx in range(len(set(y)))
      ]
      if self.model is None:
          print("The model returned is empty!")
          exit()
  
imports: from sklearn.base import BaseEstimator
  from sklearn.base import RegressorMixin, ClassifierMixin
  from sklearn.metrics import mean_squared_error, accuracy_score
  import numpy
  import scipy.sparse
  import statistics
  from sklearn.utils import check_X_y
  from ctypes import *
  from os import path
  from sys import platform
label_desc: Use image node_id 5 for calling the TGBMModel obj's underlying member method code with example usage: obj._sparse_fit(X, y, groups) without return types