class_docstr: Test class for fifth set of voting learner experiment tests.
docstr: Check given combination of prediction configuration options.
docstr_tok: ["Check","given","combination","of","prediction","configuration","options","."]
code: def check_learning_curve_task(self, learner_type, options_dict):
      """Check given combination of prediction configuration options."""
      # create a configuration file with the given options
      (
          config_path,
          estimator_names,
          _,
          custom_learner,
          _,
          output_metrics,
          model_kwargs_list,
          _,
          sampler_list,
          _,
          _,
          learning_curve_cv_folds,
          learning_curve_train_sizes,
      ) = fill_in_config_options_for_voting_learners(
          learner_type, "learning_curve", options_dict
      )
  
      #  mock the `__init__()` method for the `VotingLearner` class so
      # that we can check that the voting learner was instantiated with
      # the right arguments; note that we are doing this mock separately
      # from all the others below since any `__init__`` patch needs to
      # return a `None` value which the other ones do not
      init_patcher = patch.object(
          VotingLearner, "__init__", return_value=None
      )
  
      # mock the `learning_curve()` method for the `VotingLearner` class;
      # this method needs to return a tuple of 4 values
      learning_curve_return_value = (
          [[0, 0]],
          [[0, 0]],
          [[0, 0]],
          [[0, 0]],
      )
      learning_curve_patcher = patch.object(
          VotingLearner,
          "learning_curve",
          return_value=learning_curve_return_value,
      )
  
      # we also need to patch the `_create_learner_result_dicts()` function
      # since there are no actual results
      clrd_patcher = patch(
          "skll.experiments._create_learner_result_dicts",
          return_value={},
      )
  
      # we also need to patch some other output functions that write
      # various results to disk since we are not actually producing
      # any results from `evaluate()`
      output_patchers = patch.multiple(
          "skll.experiments",
          _print_fancy_output=DEFAULT,
          _write_summary_file=DEFAULT,
          generate_learning_curve_plots=DEFAULT,
      )
  
      mock_vl_init = init_patcher.start()
      mock_vl_learning_curve = learning_curve_patcher.start()
      clrd_patcher.start()
      output_patchers.start()
  
      # run the configuration file but with various methods/attributes for
      # `VotingLearner` mocked so that we can check that things were called
      # as expected without actually needing to evaluate any models
      with patch.multiple(VotingLearner, model=DEFAULT, create=True):
          run_configuration(config_path, quiet=True, local=True)
  
          # check that init was called the expected number of times which
          # is the number of metrics we wanted the learning curve for
          self.assertEqual(mock_vl_init.call_count, len(output_metrics))
  
          # check that the init call had the expected arguments
          expected_init_args = (estimator_names,)
          expected_init_kwargs = {
              "voting": "soft"
              if options_dict["with_soft_voting"]
              else "hard",
              "custom_learner_path": custom_learner,
              "feature_scaling": "none",
              "pos_label": None,
              "min_feature_count": 1,
              "model_kwargs_list": model_kwargs_list,
              "sampler_list": sampler_list,
              "sampler_kwargs_list": None,
          }
  
          actual_call = mock_vl_init.call_args
          self.assertEqual(actual_call[0], expected_init_args)
          for key, expected_value in expected_init_kwargs.items():
              actual_value = actual_call[1][key]
              self.assertEqual(actual_value, expected_value)
  
          # check that predict was called the expected number of times
          self.assertEqual(
              mock_vl_learning_curve.call_count, len(output_metrics)
          )
  
          # check that each predict call had the expected arguments
          expected_learning_curve_kwargs = {
              "cv_folds": learning_curve_cv_folds,
              "train_sizes": learning_curve_train_sizes,
          }
  
          for idx, actual_call in enumerate(
              mock_vl_learning_curve.call_args_list
          ):
              actual_args = actual_call[0]
              self.assertTrue(isinstance(actual_args[0], FeatureSet))
              self.assertEqual(
                  set(actual_args[0].labels), {"cat", "dog"}
              )
              self.assertEqual(actual_args[1], output_metrics[idx])
              for (
                  key,
                  expected_value,
              ) in expected_learning_curve_kwargs.items():
                  actual_value = actual_call[1][key]
                  self.assertEqual(actual_value, expected_value)
  
      # stop all the manual patchers
      _ = output_patchers.stop()
      _ = clrd_patcher.stop()
      _ = learning_curve_patcher.stop()
      _ = init_patcher.stop()
  
file_path: skll/tests/test_voting_learners_expts_5.py
imports: import unittest
  from itertools import product
  from pathlib import Path
  from unittest.mock import DEFAULT, patch
  from skll.data import FeatureSet
  from skll.experiments import run_configuration
  from skll.learner.voting import VotingLearner
  from skll.utils.testing import BoolDict, config_dir, create_jsonlines_feature_files, fill_in_config_options_for_voting_learners, output_dir, remove_jsonlines_feature_files, test_dir, train_dir
label_desc: Use image node_id 3 for calling the TestVotingLearnersExptsFive obj's underlying member method code with example usage: obj.check_learning_curve_task(learner_type, options_dict) without return types