docstr: ...SolverTest SDCA on specific case of Poisson regression with
  indentity link
docstr_tok: ["...","SolverTest","SDCA","on","specific","case","of","Poisson","regression","with","indentity","link"]
code: def test_sdca_identity_poisreg(self):
      """...SolverTest SDCA on specific case of Poisson regression with
      indentity link
      """
      l_l2sq = 1e-3
      n_samples = 10000
      n_features = 3
  
      np.random.seed(123)
      weight0 = np.random.rand(n_features).astype(self.dtype)
      features = np.random.rand(n_samples, n_features).astype(
          self.dtype
      )
  
      for intercept in [None, 0.45]:
          if intercept is None:
              fit_intercept = False
          else:
              fit_intercept = True
  
          simu = SimuPoisReg(
              weight0,
              intercept=intercept,
              features=features,
              n_samples=n_samples,
              link="identity",
              verbose=False,
              dtype=self.dtype,
          )
          features, labels = simu.simulate()
  
          model = ModelPoisReg(
              fit_intercept=fit_intercept, link="identity"
          )
          model.fit(features, labels)
  
          sdca = SDCA(
              l_l2sq=l_l2sq,
              max_iter=100,
              verbose=False,
              tol=1e-14,
              seed=TestSolver.sto_seed,
          )
  
          sdca.set_model(model).set_prox(ProxZero().astype(self.dtype))
          start_dual = np.sqrt(sdca._rand_max * l_l2sq)
          start_dual = start_dual * np.ones(sdca._rand_max)
  
          sdca.solve(start_dual)
  
          # Check that duality gap is 0
  
          places = 7
          if (self.dtype == "float32") or (
              self.dtype is np.dtype("float32")
          ):
              places = 4
          self.assertAlmostEqual(
              sdca.objective(sdca.solution),
              sdca.dual_objective(sdca.dual_solution),
              places=places,
          )
  
          # Check that original vector is approximatively retrieved
          if fit_intercept:
              original_coeffs = np.hstack((weight0, intercept))
          else:
              original_coeffs = weight0
  
          np.testing.assert_array_almost_equal(
              original_coeffs, sdca.solution, decimal=1
          )
  
          # Ensure that we solve the same problem as other solvers
          svrg = SVRG(
              max_iter=100,
              verbose=False,
              tol=1e-14,
              seed=TestSolver.sto_seed,
          )
  
          svrg.set_model(model).set_prox(
              ProxL2Sq(l_l2sq).astype(self.dtype)
          )
          svrg.solve(0.5 * np.ones(model.n_coeffs), step=1e-2)
          np.testing.assert_array_almost_equal(
              svrg.solution, sdca.solution, decimal=4
          )
  
imports: import unittest
  import numpy
  from tick.linear_model import ModelLogReg, ModelPoisReg, SimuPoisReg
  from tick.prox import ProxL1, ProxElasticNet, ProxZero, ProxL2Sq
  from tick.solver import SDCA, SVRG
  from tick.solver.tests import TestSolver
label_desc: Use image node_id 4 for calling the SDCATest obj's underlying member method code with example usage: obj.test_sdca_identity_poisreg() without return types