code: def test_compute_rule_metrics(self):
      X, y = create_numerical_test_data(10)
      ruleset = create_numerical_test_ruleset_pos()
      actual = metrics.compute_rule_metrics(ruleset, X, y)
      expected = [
          metrics.RuleContributionMetrics(
              ruleset.conjunctions[0], 1, 0, 0, 1, 7, 10, 0.5
          ),
          metrics.RuleContributionMetrics(
              ruleset.conjunctions[1], 2, 1, 1, 2, 7, 10, 0.5
          ),
          metrics.RuleContributionMetrics(
              ruleset.conjunctions[2], 2, 0, 1, 0, 8, 10, 0.6
          ),
          metrics.RuleContributionMetrics(
              ruleset.conjunctions[3], 1, 0, 0, 0, 8, 10, 2 / 3
          ),
      ]
      self.assertEqual(actual, expected)
  
file_path: AIX360/tests/rule_induction/trxf/test_metrics.py
imports: from unittest import TestCase
  import numpy
  import pandas
  import aix360.algorithms.rule_induction.trxf.metrics
  from tests.rule_induction.trxf.utilities import create_numerical_test_data, create_numerical_test_ruleset_pos
label_desc: Use image node_id 2 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_compute_rule_metrics() without return types