code: def test_select_fdr_regression(alpha, n_informative):
      # Test that fdr heuristic actually has low FDR.
      def single_fdr(alpha, n_informative, random_state):
          X, y = make_regression(
              n_samples=150,
              n_features=20,
              n_informative=n_informative,
              shuffle=False,
              random_state=random_state,
              noise=10,
          )
  
          with warnings.catch_warnings(record=True):
              # Warnings can be raised when no features are selected
              # (low alpha or very noisy data)
              univariate_filter = SelectFdr(f_regression, alpha=alpha)
              X_r = univariate_filter.fit(X, y).transform(X)
              X_r2 = (
                  GenericUnivariateSelect(
                      f_regression, mode="fdr", param=alpha
                  )
                  .fit(X, y)
                  .transform(X)
              )
  
          assert_array_equal(X_r, X_r2)
          support = univariate_filter.get_support()
          num_false_positives = np.sum(support[n_informative:] == 1)
          num_true_positives = np.sum(support[:n_informative] == 1)
  
          if num_false_positives == 0:
              return 0.0
          false_discovery_rate = num_false_positives / (
              num_true_positives + num_false_positives
          )
          return false_discovery_rate
  
      # As per Benjamini-Hochberg, the expected false discovery rate
      # should be lower than alpha:
      # FDR = E(FP / (TP + FP)) <= alpha
      false_discovery_rate = np.mean(
          [
              single_fdr(alpha, n_informative, random_state)
              for random_state in range(100)
          ]
      )
      assert alpha >= false_discovery_rate
  
      # Make sure that the empirical false discovery rate increases
      # with alpha:
      if false_discovery_rate != 0:
          assert false_discovery_rate > alpha / 10
  
imports: import itertools
  import warnings
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from scipy import sparse, stats
  from sklearn.datasets import load_iris, make_classification, make_regression
  from sklearn.feature_selection import GenericUnivariateSelect, SelectFdr, SelectFpr, SelectFwe, SelectKBest, SelectPercentile, chi2, f_classif, f_oneway, f_regression, mutual_info_classif, mutual_info_regression, r_regression
  from sklearn.utils import safe_mask
  from sklearn.utils._testing import _convert_container, assert_almost_equal, assert_array_almost_equal, assert_array_equal, ignore_warnings
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 23 for calling a global function with example usage: test_select_fdr_regression(alpha, n_informative) and returns: false_discovery_rate, int