class_docstr: Test class for custom metric tests.
docstr: Test config with metric defined in a file named kappa.
docstr_tok: ["Test","config","with","metric","defined","in","a","file","named","kappa","."]
code: def test_custom_metric_config_experiment_with_kappa_filename(self):
      """Test config with metric defined in a file named kappa."""
      # Run experiment
      train_file = other_dir / "examples_train.jsonlines"
      test_file = other_dir / "examples_test.jsonlines"
      config_path = fill_in_config_paths_for_single_file(
          config_dir / "test_custom_metrics_kappa.template.cfg",
          train_file,
          test_file,
      )
      run_configuration(config_path, local=True, quiet=True)
  
      # Check results for objective functions and output metrics
  
      # objective function f075_macro
      with open(
          output_dir
          / "test_custom_metrics_kappa_train_examples_train.jsonlines"
          "_test_examples_test.jsonlines_LogisticRegression.results.json"
      ) as f:
          result_dict = json.load(f)[0]
  
      test_objective_value = result_dict["score"]
      test_output_metrics_dict = result_dict["additional_scores"]
      test_accuracy_value = test_output_metrics_dict[
          "balanced_accuracy"
      ]
      test_dummy_metric_value = test_output_metrics_dict["dummy_metric"]
  
      # check that the values are as expected
      self.assertAlmostEqual(test_objective_value, 0.9699, places=4)
      self.assertAlmostEqual(test_accuracy_value, 0.9792, places=4)
      self.assertEqual(test_dummy_metric_value, 1.0)
  
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 18 for calling the TestCustomMetrics obj's underlying member method code with example usage: obj.test_custom_metric_config_experiment_with_kappa_filename() without return types