docstr: ...Test RobustLinearRegression setting of parameter of slope_fdr
          
docstr_tok: ["...","Test","RobustLinearRegression","setting","of","parameter","of","slope_fdr"]
code: def test_RobustLinearRegression_penalty_slope_fdr(self):
      """...Test RobustLinearRegression setting of parameter of slope_fdr"""
      slope_fdr1 = 0.6
      slope_fdr2 = 0.3
      for penalty in RobustLinearRegression._penalties.keys():
          if penalty == "slope":
              learner = RobustLinearRegression(
                  C_sample_intercepts=1.0,
                  penalty=penalty,
                  C=self.float_1,
                  slope_fdr=slope_fdr1,
              )
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(learner.slope_fdr, slope_fdr1)
              self.assertEqual(
                  learner._prox_obj.strength, 1.0 / self.float_1
              )
              self.assertEqual(learner._prox_obj.fdr, slope_fdr1)
  
              learner.slope_fdr = slope_fdr2
              self.assertEqual(learner.C, self.float_1)
              self.assertEqual(learner.slope_fdr, slope_fdr2)
              self.assertEqual(learner._prox_obj.fdr, slope_fdr2)
          else:
              msg = (
                  '^Penalty "%s" has no ``slope_fdr`` attribute$$'
                  % penalty
              )
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  RobustLinearRegression(
                      C_sample_intercepts=1.0,
                      penalty=penalty,
                      slope_fdr=0.8,
                  )
  
              learner = RobustLinearRegression(
                  C_sample_intercepts=1.0, penalty=penalty
              )
              msg = (
                  '^Penalty "%s" has no ``slope_fdr`` attribute$$'
                  % penalty
              )
              with self.assertWarnsRegex(RuntimeWarning, msg):
                  learner.slope_fdr = slope_fdr1
  
      slope_fdr1 = 0.33
      slope_fdr2 = 0.78
      learner = RobustLinearRegression(
          C_sample_intercepts=self.float_1,
          slope_fdr=slope_fdr1,
          penalty="slope",
      )
      self.assertEqual(learner.slope_fdr, slope_fdr1)
      self.assertEqual(learner._prox_obj.fdr, slope_fdr1)
      learner.slope_fdr = slope_fdr2
      self.assertEqual(learner.slope_fdr, slope_fdr2)
      self.assertEqual(learner._prox_obj.fdr, slope_fdr2)
  
      msg = "^``slope_fdr`` must be in \(0, 1\), got -1.0"
      with self.assertRaisesRegex(ValueError, msg):
          RobustLinearRegression(
              C_sample_intercepts=1.0, penalty="slope", slope_fdr=-1.0
          )
  
      msg = "^``slope_fdr`` must be in \(0, 1\), got 1.5"
      with self.assertRaisesRegex(ValueError, msg):
          RobustLinearRegression(
              C_sample_intercepts=1.0, penalty="slope", slope_fdr=1.5
          )
  
      msg = "^``slope_fdr`` cannot be `None`$"
      with self.assertRaisesRegex(ValueError, msg):
          RobustLinearRegression(
              C_sample_intercepts=1.0, penalty="slope", slope_fdr=None
          )
  
      msg = "^``slope_fdr`` must be a finite number, got inf$"
      with self.assertRaisesRegex(ValueError, msg):
          RobustLinearRegression(
              C_sample_intercepts=1.0, penalty="slope", slope_fdr=np.inf
          )
  
imports: import itertools
  import unittest
  import numpy
  from tick.base.inference import InferenceTest
  from tick.robust import RobustLinearRegression
  from tick.simulation import weights_sparse_gauss, features_normal_cov_toeplitz
  from tick.metrics import support_fdp, support_recall
label_desc: Use image node_id 12 for calling the Test obj's underlying member method code with example usage: obj.test_RobustLinearRegression_penalty_slope_fdr() without return types