class_docstr: Test cases for the whole feature selection algorithm.
class_docstr_tok: ["Test","cases","for","the","whole","feature","selection","algorithm","."]
code: def test_binary_target_binary_features(self):
      # Binomial random variables and binomial target
      y = pd.Series(np.random.binomial(1, 0.5, 5000))
      X = pd.DataFrame(index=range(5000))
  
      for i in range(10):
          X["irr{}".format(i)] = np.random.binomial(1, 0.1, 5000)
  
      for i in range(10, 20):
          X["irr{}".format(i)] = np.random.binomial(1, 0.8, 5000)
  
      z = (
          y
          - np.random.binomial(1, 0.01, 5000)
          + np.random.binomial(1, 0.01, 5000)
      )
      z[z == -1] = 0
      z[z == 2] = 1
      X["rel1"] = z
  
      z = (
          y
          - np.random.binomial(1, 0.05, 5000)
          + np.random.binomial(1, 0.05, 5000)
      )
      z[z == -1] = 0
      z[z == 2] = 1
      X["rel2"] = z
  
      z = (
          y
          - np.random.binomial(1, 0.10, 5000)
          + np.random.binomial(1, 0.10, 5000)
      )
      z[z == -1] = 0
      z[z == 2] = 1
      X["rel3"] = z
  
      z = (
          y
          - np.random.binomial(1, 0.15, 5000)
          + np.random.binomial(1, 0.15, 5000)
      )
      z[z == -1] = 0
      z[z == 2] = 1
      X["rel4"] = z
  
      z = (
          y
          - np.random.binomial(1, 0.20, 5000)
          + np.random.binomial(1, 0.20, 5000)
      )
      z[z == -1] = 0
      z[z == 2] = 1
      X["rel5"] = z
  
      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", "rel5"]
          )
  
      self.assertGreater(len(feat_rej), 0)
  
      # Test type outputs
      for i in range(1, 6):
          row = df_bh.loc["rel{}".format(i)]
          self.assertEqual(row.feature, "rel{}".format(i))
          self.assertEqual(row.type, "binary")
  
      for i in range(1, 20):
          row = df_bh.loc["irr{}".format(i)]
          self.assertEqual(row.feature, "irr{}".format(i))
          self.assertEqual(row.type, "binary")
  
          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 3 for calling the FeatureSignificanceTestCase obj's underlying member method code with example usage: obj.test_binary_target_binary_features() without return types