class_docstr: Analyze results of machine learning experiments.
docstr: T-test with correction used to counteract multiple comparisons.
  
  https://en.wikipedia.org/wiki/Bonferroni_correction
docstr_tok: ["T-test","with","correction","used","to","counteract","multiple","comparisons",".","https",":","\/\/en.wikipedia.org\/wiki\/Bonferroni_correction"]
code: def t_test_with_bonferroni_correction(
      self, metric_name=None, alpha=0.05
  ):
      """T-test with correction used to counteract multiple comparisons.
  
      https://en.wikipedia.org/wiki/Bonferroni_correction
      """
      self._check_is_evaluated()
      metric_name = self._validate_metric_name(metric_name)
  
      df_t_test, _ = self.t_test(metric_name=metric_name)
      idx_estim_1 = df_t_test["estimator_1"].unique()
      idx_estim_2 = df_t_test["estimator_2"].unique()
      estim_1 = len(idx_estim_1)
      estim_2 = len(idx_estim_2)
      critical_value = alpha / (estim_1 * estim_2)
  
      bonfer_test = df_t_test["p_val"] <= critical_value
  
      bonfer_test_reshaped = bonfer_test.values.reshape(
          estim_1, estim_2
      )
  
      bonfer_df = pd.DataFrame(
          bonfer_test_reshaped, index=idx_estim_1, columns=idx_estim_2
      )
  
      return bonfer_df
  
imports: import itertools
  import numpy
  import pandas
  from scipy import stats
  from scipy.stats import ranksums, ttest_ind
  from sktime.benchmarking.base import BaseResults
  from sktime.exceptions import NotEvaluatedError
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 12 for calling the Evaluator obj's underlying member method code with example usage: obj.t_test_with_bonferroni_correction(metric_name, alpha) and returns: bonfer_df