docstr: Test longitudinal multinomial model loss.
docstr_tok: ["Test","longitudinal","multinomial","model","loss","."]
code: def test_loss(self):
      """Test longitudinal multinomial model loss."""
      X, _, _ = LongitudinalFeaturesLagger(
          n_lags=self.n_lags
      ).fit_transform(self.X)
      model = ModelSCCS(n_intervals=2, n_lags=self.n_lags).fit(
          X, self.y
      )
      loss = model.loss(coeffs=np.array([0.0, 0.0, 1.0, 0.0]))
      expected_loss = -np.log((np.e / (2 * np.e) * 1 / (1 + np.e))) / 2
      self.assertAlmostEqual(loss, expected_loss)
  
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 2 for calling the ModelSCCSTest obj's underlying member method code with example usage: obj.test_loss() without return types