class_docstr: Analyze results of machine learning experiments.
docstr: T-test on all possible combinations between the estimators.
docstr_tok: ["T-test","on","all","possible","combinations","between","the","estimators","."]
code: def t_test(self, metric_name=None):
      """T-test on all possible combinations between the estimators."""
      self._check_is_evaluated()
      metric_name = self._validate_metric_name(metric_name)
      metrics_per_estimator_dataset = (
          self._get_metrics_per_estimator_dataset(metric_name)
      )
  
      t_df = pd.DataFrame()
      perms = itertools.product(
          metrics_per_estimator_dataset.keys(), repeat=2
      )
      values = np.array([])
      for perm in perms:
          x = np.array(metrics_per_estimator_dataset[perm[0]])
          y = np.array(metrics_per_estimator_dataset[perm[1]])
          t_stat, p_val = ttest_ind(x, y)
  
          t_test = {
              "estimator_1": perm[0],
              "estimator_2": perm[1],
              "t_stat": t_stat,
              "p_val": p_val,
          }
  
          t_df = pd.concat(
              [t_df, pd.DataFrame(t_test, index=[0])], ignore_index=True
          )
          values = np.append(values, t_stat)
          values = np.append(values, p_val)
  
      index = t_df["estimator_1"].unique()
      values_names = ["t_stat", "p_val"]
      col_idx = pd.MultiIndex.from_product([index, values_names])
      values_reshaped = values.reshape(
          len(index), len(values_names) * len(index)
      )
  
      values_df_multiindex = pd.DataFrame(
          values_reshaped, index=index, columns=col_idx
      )
  
      return t_df, values_df_multiindex
  
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 9 for calling the Evaluator obj's underlying member method code with example usage: obj.t_test(metric_name) and returns: t_df,  values_df_multiindex