code: def test_rank_classification_default_weights(self):
      # num_classes = 2
      self.assertDictClose(
          metrics.rank_classification(
              [
                  # 0
                  ((0, 0), True, 1.0, 1),
                  ((0, 1), False, 1.0, 1),
                  # 1
                  ((1, 0), False, 1.0, 1),
                  ((1, 1), True, 1.0, 1),
                  # 0
                  ((2, 0), True, 1.0, 1),
                  ((2, 1), False, 1.0, 1),
                  # 0
                  ((3, 0), True, 1.0, 1),
                  ((3, 1), False, 1.0, 1),
              ],
              [0.1, 0.5, 1.0, 1.1, 0.3, 0.1, 0.6, 0.5],
              num_classes=2,
          ),
          {
              "accuracy": 75.0,
              "auc-pr": 50.0,
              "auc-roc": 66.6666667,
              "f1": 66.6666667,
          },
      )
  
      # num_classes = 3
      self.assertDictClose(
          metrics.rank_classification(
              [
                  # 1
                  ((0, 0), False, 1.0, 1),
                  ((0, 1), True, 1.0, 1),
                  ((0, 2), False, 1.0, 1),
                  # 0
                  ((1, 0), True, 1.0, 1),
                  ((1, 1), False, 1.0, 1),
                  ((1, 2), False, 1.0, 1),
                  # 2
                  ((2, 0), False, 1.0, 1),
                  ((2, 1), False, 1.0, 1),
                  ((2, 2), True, 1.0, 1),
              ],
              [0.1, 0.5, 0.0, -2, -1, -3, 3.0, 3.1, 3.2],
              num_classes=3,
          ),
          {
              "accuracy": 66.6666667,
              "mean_3class_f1": 55.5555556,
          },
      )
  
      # num_classes = 3, multi-label
      self.assertDictClose(
          metrics.rank_classification(
              [
                  # 1
                  ((0, 0), False, 1.0, 1),
                  ((0, 1), True, 1.0, 1),
                  ((0, 2), False, 1.0, 1),
                  # 0, 2
                  ((1, 0), True, 1.0, 1),
                  ((1, 1), False, 1.0, 1),
                  ((1, 2), True, 1.0, 1),
                  # 1, 2
                  ((2, 0), False, 1.0, 1),
                  ((2, 1), True, 1.0, 1),
                  ((2, 2), True, 1.0, 1),
              ],
              [0.1, 0.5, 0.0, -2, -1, -3, 3.0, 3.1, 3.2],
              num_classes=3,
          ),
          {
              "accuracy": 66.6666667,
          },
      )
  
      # num_classes = None, multi-answer
      self.assertDictClose(
          metrics.rank_classification(
              [
                  # 1
                  ((0, 0), False, 1.0, 1),
                  ((0, 1), True, 1.0, 1),
                  # 0, 3
                  ((1, 0), True, 1.0, 1),
                  ((1, 1), False, 1.0, 1),
                  ((1, 2), True, 1.0, 1),
                  # 0
                  ((2, 0), True, 1.0, 1),
              ],
              [0.1, 0.5, -2, -1, -3, 3.0],
              num_classes=None,
          ),
          {
              "accuracy": 66.6666667,
          },
      )
  
imports: from unittest import mock
  from absl.testing import absltest
  import numpy
  import seqio
  import sklearn.metrics
  from t5.evaluation import metrics
  from t5.evaluation import test_utils
label_desc: Use image node_id 30 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_rank_classification_default_weights() without return types