docstr: Test longitudinal multinomial model gradient value.
docstr_tok: ["Test","longitudinal","multinomial","model","gradient","value","."]
code: def test_grad(self):
      """Test longitudinal multinomial model gradient value."""
      X = [np.array([[0, 0.0], [1, 0]]), np.array([[1, 0.0], [0, 1]])]
      X, _, _ = LongitudinalFeaturesLagger(
          n_lags=self.n_lags
      ).fit_transform(X)
      model = ModelSCCS(n_intervals=2, n_lags=self.n_lags).fit(
          X, self.y
      )
      grad = model.grad(coeffs=np.array([0.0, 0.0, 1.0, 0.0]))
      expected_grad = (
          -np.array(
              [
                  -1 / 2 - 1 / (1 + np.e),
                  1 - np.e / (1 + np.e),
                  1 - np.e / (1 + np.e),
                  0,
              ]
          )
          / 2
      )
      np.testing.assert_almost_equal(grad, expected_grad, decimal=15)
  
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 3 for calling the ModelSCCSTest obj's underlying member method code with example usage: obj.test_grad() without return types