docstr: ...Test LinearRegression setting of parameter of elastic_net_ratio
          
docstr_tok: ["...","Test","LinearRegression","setting","of","parameter","of","elastic_net_ratio"]
code: def test_LinearRegression_penalty_elastic_net_ratio(self):
      """...Test LinearRegression setting of parameter of elastic_net_ratio"""
      ratio_1 = 0.6
      ratio_2 = 0.3
  
      for penalty in LinearRegression._penalties.keys():
          if penalty == "elasticnet":
              learner = LinearRegression(
                  penalty=penalty,
                  C=self.float_1,
                  elastic_net_ratio=ratio_1,
              )
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(learner.elastic_net_ratio, ratio_1)
              self.assertEqual(
                  learner._prox_obj.strength, 1.0 / self.float_1
              )
              self.assertEqual(learner._prox_obj.ratio, ratio_1)
  
              learner.elastic_net_ratio = ratio_2
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(learner.elastic_net_ratio, ratio_2)
              self.assertEqual(learner._prox_obj.ratio, ratio_2)
          else:
              msg = (
                  '^Penalty "%s" has no elastic_net_ratio attribute$$'
                  % penalty
              )
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  if penalty == "binarsity":
                      LinearRegression(
                          penalty=penalty,
                          elastic_net_ratio=0.8,
                          blocks_start=[0],
                          blocks_length=[1],
                      )
                  else:
                      LinearRegression(
                          penalty=penalty, elastic_net_ratio=0.8
                      )
  
              if penalty == "binarsity":
                  learner = LinearRegression(
                      penalty=penalty,
                      blocks_start=[0],
                      blocks_length=[1],
                  )
              else:
                  learner = LinearRegression(penalty=penalty)
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  learner.elastic_net_ratio = ratio_1
  
imports: import itertools
  import unittest
  from itertools import product
  import numpy
  from scipy.linalg import norm
  from tick.base.inference import InferenceTest
  from tick.linear_model import SimuLinReg, LinearRegression
  from tick.simulation import weights_sparse_gauss
label_desc: Use image node_id 9 for calling the Test obj's underlying member method code with example usage: obj.test_LinearRegression_penalty_elastic_net_ratio() without return types