docstr: Test longitudinal multinomial model gradient properties.
docstr_tok: ["Test","longitudinal","multinomial","model","gradient","properties","."]
code: def test_grad_loss_consistency(self):
      """Test longitudinal multinomial model gradient properties."""
      n_lags = np.repeat(9, 3).astype(dtype="uint64")
      sim = SimuSCCS(
          500,
          36,
          3,
          n_lags,
          None,
          "single_exposure",
          seed=42,
          verbose=False,
      )
      _, X, y, censoring, coeffs = sim.simulate()
      coeffs = np.hstack(coeffs)
      X, _, _ = LongitudinalFeaturesLagger(n_lags=n_lags).fit_transform(
          X, censoring
      )
      model = ModelSCCS(n_intervals=36, n_lags=n_lags).fit(
          X, y, censoring
      )
      self._test_grad(model, coeffs)
      X_sparse = [csr_matrix(x) for x in X]
      model = ModelSCCS(n_intervals=36, n_lags=n_lags).fit(
          X_sparse, y, censoring
      )
      self._test_grad(model, coeffs)
  
file_path: tick/tick/survival/tests/model_sccs_test.py
imports: import unittest, pickle
  import numpy
  from scipy.optimize import check_grad, fmin_bfgs
  from scipy.linalg import norm
  from scipy.sparse import csr_matrix
  from tick.survival import SimuSCCS, ModelSCCS
  from tick.preprocessing import LongitudinalFeaturesLagger
  from tick.solver import SVRG
  from tick.prox import ProxZero
label_desc: Use image node_id 4 for calling the ModelSCCSTest obj's underlying member method code with example usage: obj.test_grad_loss_consistency() without return types