class_docstr: Test class for custom metric tests.
docstr: Test to check values of custom metrics.
docstr_tok: ["Test","to","check","values","of","custom","metrics","."]
code: def test_register_custom_metric_values(self):
      """Test to check values of custom metrics."""
      # register two metrics in the same file
      custom_metrics_file = other_dir / "custom_metrics.py"
      register_custom_metric(custom_metrics_file, "f075_macro")
      register_custom_metric(custom_metrics_file, "ratio_of_ones")
  
      # check that the values that SKLL would compute matches what we expect
      y_true = [1, 1, 1, 0, 2, 1, 2, 0, 1]
      y_pred = [0, 1, 1, 0, 1, 2, 0, 1, 2]
      skll_value = use_score_func("f075_macro", y_true, y_pred)
      sklearn_value = fbeta_score(
          y_true, y_pred, beta=0.75, average="macro"
      )
      self.assertEqual(skll_value, sklearn_value)
  
      y_true = [1, 1, 1, 0]
      y_pred = [0, 1, 1, 0]
      skll_value = use_score_func("ratio_of_ones", y_true, y_pred)
      true_ones = len([true for true in y_true if true == 1])
      pred_ones = len([pred for pred in y_pred if pred == 1])
      expected_value = pred_ones / (true_ones + pred_ones)
      self.assertEqual(skll_value, expected_value)
  
imports: import json
  import sys
  import unittest
  from itertools import chain
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_raises_regex
  from sklearn.metrics import fbeta_score
  import skll.metrics
  from skll.data import NDJReader
  from skll.experiments import run_configuration
  from skll.learner import Learner
  from skll.metrics import _CUSTOM_METRICS, register_custom_metric, use_score_func
  from skll.utils.testing import config_dir, fill_in_config_paths_for_single_file, make_classification_data, other_dir, output_dir, unlink
label_desc: Use image node_id 14 for calling the TestCustomMetrics obj's underlying member method code with example usage: obj.test_register_custom_metric_values() without return types