class_docstr: Test class for output tests.
docstr: Test that the ylimits for learning curves are generated as expected.
docstr_tok: ["Test","that","the","ylimits","for","learning","curves","are","generated","as","expected","."]
code: def test_learning_curve_ylimits(self):
      """Test that the ylimits for learning curves are generated as expected."""
      # create a test data frame
      df_test = pd.DataFrame.from_dict(
          {
              "test_score_std": {
                  0: 0.16809136190418694,
                  1: 0.18556201422712379,
                  2: 0.15002727816517414,
                  3: 0.15301923832338646,
                  4: 0.15589815327205431,
                  5: 0.68205316443171948,
                  6: 0.77441075727706354,
                  7: 0.83838056331276678,
                  8: 0.84770116657005623,
                  9: 0.8708014559726478,
              },
              "value": {
                  0: 0.4092496971394447,
                  1: 0.2820507715115001,
                  2: 0.24533811547921261,
                  3: 0.21808651942296109,
                  4: 0.19767367891431534,
                  5: -2.3540980769230773,
                  6: -3.1312445327182394,
                  7: -3.2956790939674137,
                  8: -3.4843050005436713,
                  9: -3.6357879085645455,
              },
              "train_score_std": {
                  0: 0.15950199460682787,
                  1: 0.090992452273091703,
                  2: 0.068488654201949981,
                  3: 0.055223120652733763,
                  4: 0.03172452509259388,
                  5: 1.0561586240460523,
                  6: 0.53955995320300709,
                  7: 0.40477740983901211,
                  8: 0.34148185048394258,
                  9: 0.20791478156554272,
              },
              "variable": {
                  0: "train_score_mean",
                  1: "train_score_mean",
                  2: "train_score_mean",
                  3: "train_score_mean",
                  4: "train_score_mean",
                  5: "train_score_mean",
                  6: "train_score_mean",
                  7: "train_score_mean",
                  8: "train_score_mean",
                  9: "train_score_mean",
              },
              "metric": {
                  0: "r2",
                  1: "r2",
                  2: "r2",
                  3: "r2",
                  4: "r2",
                  5: "neg_mean_squared_error",
                  6: "neg_mean_squared_error",
                  7: "neg_mean_squared_error",
                  8: "neg_mean_squared_error",
                  9: "neg_mean_squared_error",
              },
          }
      )
  
      # compute the y-limits
      ylimits_dict = _compute_ylimits_for_featureset(
          df_test, ["r2", "neg_mean_squared_error"]
      )
  
      self.assertEqual(len(ylimits_dict), 2)
      assert_almost_equal(
          ylimits_dict["neg_mean_squared_error"][0], -3.94, decimal=2
      )
      self.assertEqual(ylimits_dict["neg_mean_squared_error"][1], 0)
      self.assertEqual(ylimits_dict["r2"][0], 0)
      assert_almost_equal(ylimits_dict["r2"][1], 0.67, decimal=2)
  
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 19 for calling the TestOutput obj's underlying member method code with example usage: obj.test_learning_curve_ylimits() without return types