class_docstr: Test cases for the whole feature selection algorithm.
class_docstr_tok: ["Test","cases","for","the","whole","feature","selection","algorithm","."]
code: def test_real_target_mixed_case(self):
      # Mixed case with real target
      y = pd.Series(np.random.normal(0, 1, 5000))
      X = pd.DataFrame(index=range(5000))
  
      z = y.copy()
      z[z <= 0] = 0
      z[z > 0] = 1
  
      X["rel1"] = z
      X["rel2"] = y
      X["rel3"] = y**2
      X["rel4"] = np.sqrt(abs(y))
  
      X["irr1"] = np.random.normal(0, 1, 5000)
      X["irr2"] = np.random.poisson(1, 5000)
      X["irr3"] = np.random.binomial(1, 0.1, 5000)
      X["irr4"] = np.random.normal(0, 1, 5000)
      X["irr5"] = np.random.poisson(1, 5000)
      X["irr6"] = np.random.binomial(1, 0.05, 5000)
      X["irr7"] = np.random.normal(0, 1, 5000)
      X["irr8"] = np.random.poisson(1, 5000)
      X["irr9"] = np.random.binomial(1, 0.2, 5000)
  
      df_bh = calculate_relevance_table(X, y)
      feat_rej = df_bh.loc[df_bh.relevant].feature
  
      # Make sure all selected variables are relevant
      for kept_feature in feat_rej:
          self.assertIn(kept_feature, ["rel1", "rel2", "rel3", "rel4"])
  
      self.assertGreater(len(feat_rej), 0)
  
      # Test type outputs
      for i in range(1, 5):
          row = df_bh.loc["rel{}".format(i)]
          self.assertEqual(row.feature, "rel{}".format(i))
          if i == 1:
              self.assertEqual(row.type, "binary")
          else:
              self.assertEqual(row.type, "real")
  
      for i in range(1, 10):
          row = df_bh.loc["irr{}".format(i)]
          self.assertEqual(row.feature, "irr{}".format(i))
          if i in [3, 6, 9]:
              self.assertEqual(row.type, "binary")
          else:
              self.assertEqual(row.type, "real")
  
          self.assertFalse(row.relevant)
  
file_path: tsfresh/tests/units/feature_selection/test_feature_significance.py
imports: from unittest import TestCase
  import numpy
  import pandas
  from tsfresh.feature_selection.relevance import calculate_relevance_table
label_desc: Use image node_id 5 for calling the FeatureSignificanceTestCase obj's underlying member method code with example usage: obj.test_real_target_mixed_case() without return types