class_docstr: Analyze results of machine learning experiments.
docstr: Non-parametric test of consistent differences between observation pairs.
  
  The test counts the number of observations that are greater, smaller
  and equal to the mean
  `<http://en.wikipedia.org/wiki/Wilcoxon_rank-sum_test>`_.
docstr_tok: ["Non-parametric","test","of","consistent","differences","between","observation","pairs",".","The","test","counts","the","number","of","observations","that","are","greater",",","smaller","and","equal","to","the","mean","`","<","http",":","\/\/en.wikipedia.org\/wiki\/Wilcoxon_rank-sum_test",">","`","_","."]
code: def ranksum_test(self, metric_name=None):
      """Non-parametric test of consistent differences between observation pairs.
  
      The test counts the number of observations that are greater, smaller
      and equal to the mean
      `<http://en.wikipedia.org/wiki/Wilcoxon_rank-sum_test>`_.
      """
      self._check_is_evaluated()
      metric_name = self._validate_metric_name(metric_name)
      metrics_per_estimator_dataset = (
          self._get_metrics_per_estimator_dataset(metric_name)
      )
  
      ranksum_df = pd.DataFrame()
      perms = itertools.product(
          metrics_per_estimator_dataset.keys(), repeat=2
      )
      values = np.array([])
      for perm in perms:
          x = metrics_per_estimator_dataset[perm[0]]
          y = metrics_per_estimator_dataset[perm[1]]
          t_stat, p_val = ranksums(x, y)
          ranksum = {
              "estimator_1": perm[0],
              "estimator_2": perm[1],
              "t_stat": t_stat,
              "p_val": p_val,
          }
          ranksum_df = pd.concat(
              [ranksum_df, pd.DataFrame(ranksum, index=[0])],
              ignore_index=True,
          )
          values = np.append(values, t_stat)
          values = np.append(values, p_val)
  
      index = ranksum_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 ranksum_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 11 for calling the Evaluator obj's underlying member method code with example usage: obj.ranksum_test(metric_name) and returns: ranksum_df,  values_df_multiindex