class_docstr: Test class for output tests.
docstr: Ensure that the learning curve results match scikit-learn.
docstr_tok: ["Ensure","that","the","learning","curve","results","match","scikit-learn","."]
code: def check_learning_curve_implementation(self, with_probability):
      """Ensure that the learning curve results match scikit-learn."""
      # This test is different from the other tests which just use regression data.
      # The reason is that we want this test to fail in case our implementation
      # diverges from the scikit-learn implementation. This test essentially
      # serves as a regression test as well.
  
      # create a single featureset from the digits data
      fs_digits, _ = make_digits_data(test_size=0)
  
      # get the learning curve results from scikit-learn for this data
      cv_folds = 10
      random_state = 123456789
      cv = ShuffleSplit(
          n_splits=cv_folds, test_size=0.2, random_state=random_state
      )
      estimator = MultinomialNB()
      train_sizes = np.linspace(0.1, 1.0, 5)
      train_sizes1, train_scores1, test_scores1 = learning_curve(
          estimator,
          fs_digits.features,
          fs_digits.labels,
          cv=cv,
          train_sizes=train_sizes,
          scoring="accuracy",
      )
  
      # we don't want to filter out any features since scikit-learn
      # does not do that either
      learner = Learner(
          "MultinomialNB",
          min_feature_count=0,
          probability=with_probability,
      )
      (
          train_scores2,
          test_scores2,
          _,
          train_sizes2,
      ) = learner.learning_curve(
          fs_digits,
          cv_folds=cv_folds,
          train_sizes=train_sizes,
          metric="accuracy",
      )
  
      assert np.all(train_sizes1 == train_sizes2)
      assert np.allclose(train_scores1, train_scores2)
      assert np.allclose(test_scores1, test_scores2)
  
imports: import csv
  import json
  import re
  import unittest
  import warnings
  from ast import literal_eval
  from collections import defaultdict
  from itertools import chain, product
  from pathlib import Path
  from unittest.mock import Mock, patch
  import numpy
  import pandas
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from sklearn.model_selection import ShuffleSplit, learning_curve
  from sklearn.naive_bayes import MultinomialNB
  from skll.data import FeatureSet, NDJReader, NDJWriter, Reader
  from skll.experiments import run_configuration
  from skll.experiments.output import _compute_ylimits_for_featureset
  from skll.learner import Learner
  from skll.utils.constants import VALID_TASKS
  from skll.utils.logging import close_and_remove_logger_handlers, get_skll_logger
  from skll.utils.testing import backward_compatibility_dir, config_dir, create_jsonlines_feature_files, fill_in_config_options, fill_in_config_paths, fill_in_config_paths_for_single_file, make_classification_data, make_digits_data, make_regression_data, other_dir, output_dir, remove_jsonlines_feature_files, test_dir, tests_dir, train_dir, unlink
label_desc: Use image node_id 13 for calling the TestOutput obj's underlying member method code with example usage: obj.check_learning_curve_implementation(with_probability) without return types