class_docstr: Analyze results of machine learning experiments.
docstr: Determine estimator ranking.
  
  Calculates the average ranks based on the performance of each estimator on each
  dataset
docstr_tok: ["Determine","estimator","ranking",".","Calculates","the","average","ranks","based","on","the","performance","of","each","estimator","on","each","dataset"]
code: def rank(self, metric_name=None, ascending=False):
      """Determine estimator ranking.
  
      Calculates the average ranks based on the performance of each estimator on each
      dataset
      """
      self._check_is_evaluated()
      if not isinstance(ascending, bool):
          raise ValueError(
              f"`ascending` must be boolean, but found: {type(ascending)}"
          )
  
      metric_name = self._validate_metric_name(metric_name)
      column = self._get_column_name(metric_name, suffix="mean")
  
      ranked = (
          self.metrics_by_strategy_dataset.loc[
              :, ["dataset", "strategy", column]
          ]
          .set_index("strategy")
          .groupby("dataset")
          .rank(ascending=ascending)
          .reset_index()
          .groupby("strategy")
          .mean()
          .rename(columns={column: f"{metric_name}_mean_rank"})
          .reset_index()
      )
      return ranked
  
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 8 for calling the Evaluator obj's underlying member method code with example usage: obj.rank(metric_name, ascending) and returns: ranked