docstr: ...Test CoxRegression fit with different solvers and penalties
          
docstr_tok: ["...","Test","CoxRegression","fit","with","different","solvers","and","penalties"]
code: def test_CoxRegression_fit(self):
      """...Test CoxRegression fit with different solvers and penalties"""
      raw_features, times, censoring = Test.get_train_data()
  
      coeffs_pen = {
          "none": np.array(
              [
                  -0.03068462,
                  0.03940001,
                  0.16758354,
                  -0.24838003,
                  0.16940664,
                  0.9650363,
                  -0.14818724,
                  -0.0802245,
                  -1.52869811,
                  0.0414509,
              ]
          ),
          "l2": np.array(
              [
                  -0.02403681,
                  0.03455527,
                  0.13470436,
                  -0.21654892,
                  0.16637723,
                  0.83125941,
                  -0.08555382,
                  -0.12914753,
                  -1.35294435,
                  0.02312935,
              ]
          ),
          "l1": np.array(
              [
                  0.0,
                  1.48439371e-02,
                  1.03806171e-01,
                  -1.57313537e-01,
                  1.40448847e-01,
                  8.05306416e-01,
                  -5.41296030e-02,
                  -1.07753576e-01,
                  -1.37612207e00,
                  6.43289248e-05,
              ]
          ),
          "elasticnet": np.array(
              [
                  0.0,
                  0.01011823,
                  0.10530518,
                  -0.16885214,
                  0.14373715,
                  0.82547312,
                  -0.06122141,
                  -0.09479487,
                  -1.39454662,
                  0.00312597,
              ]
          ),
          "tv": np.array(
              [
                  0.03017556,
                  0.03714465,
                  0.0385349,
                  -0.10169967,
                  0.15783755,
                  0.64860815,
                  -0.00617636,
                  -0.22235137,
                  -1.07938977,
                  -0.07181225,
              ]
          ),
          "binarsity": np.array(
              [
                  0.03794176,
                  -0.04473702,
                  0.00339763,
                  0.00339763,
                  -0.16493989,
                  0.05497996,
                  0.05497996,
                  0.05497996,
                  -0.08457476,
                  -0.08457476,
                  0.0294825,
                  0.13966702,
                  0.10251257,
                  0.02550264,
                  -0.07207419,
                  -0.05594102,
                  -0.10018038,
                  -0.10018038,
                  0.10018038,
                  0.10018038,
                  -0.47859686,
                  -0.06685181,
                  -0.00850803,
                  0.55395669,
                  0.00556327,
                  -0.00185442,
                  -0.00185442,
                  -0.00185442,
                  0.26010429,
                  0.09752455,
                  -0.17881442,
                  -0.17881442,
                  0.932516,
                  0.32095387,
                  -0.49766315,
                  -0.75580671,
                  0.0593833,
                  -0.01433773,
                  0.01077109,
                  -0.05581666,
              ]
          ),
      }
  
      for penalty in self.penalties:
          if penalty == "binarsity":
              # binarize features
              n_cuts = 3
              binarizer = FeaturesBinarizer(n_cuts=n_cuts)
              features = binarizer.fit_transform(raw_features)
          else:
              features = raw_features
  
          for solver in self.solvers:
              solver_kwargs = {
                  "penalty": penalty,
                  "tol": 0,
                  "solver": solver,
                  "verbose": False,
                  "max_iter": 10,
              }
  
              if penalty != "none":
                  solver_kwargs["C"] = 50
  
              if penalty == "binarsity":
                  solver_kwargs["blocks_start"] = binarizer.blocks_start
                  solver_kwargs[
                      "blocks_length"
                  ] = binarizer.blocks_length
  
              learner = CoxRegression(**solver_kwargs)
              learner.fit(features, times, censoring)
  
              np.testing.assert_array_almost_equal(
                  coeffs_pen[penalty], learner.coeffs, decimal=1
              )
  
file_path: tick/tick/survival/tests/cox_regression_test.py
imports: import unittest
  import numpy
  from tick.base.inference import InferenceTest
  from tick.survival import SimuCoxReg, CoxRegression
  from tick.simulation import weights_sparse_gauss
  from tick.preprocessing.features_binarizer import FeaturesBinarizer
  from tick.prox import ProxZero, ProxL1, ProxL2Sq, ProxElasticNet, ProxTV, ProxBinarsity
  from tick.solver import GD, AGD
label_desc: Use image node_id 2 for calling the Test obj's underlying member method code with example usage: obj.test_CoxRegression_fit() without return types