class_docstr: Test class for output tests.
code: def check_pipeline_attribute(
      self, do_feature_hashing, learner, function_args_dict
  ):
      # look up the arguments that we computed earlier for
      # the current configuration
      estimator_type = learner.model_type._estimator_type
      train_fs, test_fs, feature_dicts, labels = function_args_dict[
          estimator_type
      ][do_feature_hashing]
  
      # which metric score are we comparing between SKLL and sklearn
      metric = "accuracy" if estimator_type == "classifier" else "r2"
  
      # train the given learner on the training set with the pipeline
      # attribute set to true
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          learner.train(train_fs, grid_search=False)
  
      # get the predictions of the learner on the test set
      skll_predictions = learner.predict(test_fs)
  
      # get the metric score on the test set via SKLL
      (_, _, _, _, _, metric_scores) = learner.evaluate(
          test_fs, output_metrics=[metric]
      )
  
      # now use the pipeline and get the predictions and get
      # the predictions and the score from the sklearn side
      pipeline = learner.pipeline
      sklearn_predictions = pipeline.predict(feature_dicts)
      sklearn_score = pipeline.score(feature_dicts, labels)
  
      # for classifiers, the predictions and scores should match exactly
      # but for regressors, they should be almost equal
      if estimator_type == "classifier":
          assert_array_equal(skll_predictions, sklearn_predictions)
          self.assertEqual(metric_scores[metric], sklearn_score)
      else:
          assert_array_almost_equal(
              skll_predictions, sklearn_predictions
          )
          assert_almost_equal(metric_scores[metric], sklearn_score)
  
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 22 for calling the TestOutput obj's underlying member method code with example usage: obj.check_pipeline_attribute(do_feature_hashing, learner, function_args_dict) without return types