class_docstr: Test class for output tests.
code: def test_pipeline_attribute(self):
      # define the classifier and regressor feature dictionaries and labels that we will test on
      # and also the classes and targets respectively
      cfeature_dicts = [
          {
              "f01": -2.87,
              "f02": 0.713,
              "f03": 2.86,
              "f04": 0.385,
              "f05": -0.989,
              "f06": 0.380,
              "f07": -0.365,
              "f08": -0.224,
              "f09": 3.45,
              "f10": 0.622,
          },
          {
              "f01": 0.058,
              "f02": -1.14,
              "f03": 2.85,
              "f04": 1.41,
              "f05": 1.60,
              "f06": 1.04,
              "f07": -0.669,
              "f08": -0.727,
              "f09": 1.82,
              "f10": 1.336,
          },
          {
              "f01": -1.80,
              "f02": 3.21,
              "f03": 0.79,
              "f04": -0.55,
              "f05": 0.059,
              "f06": -5.66,
              "f07": -3.08,
              "f08": -0.95,
              "f09": 0.188,
              "f10": -1.24,
          },
          {
              "f01": 2.270,
              "f02": 2.271,
              "f03": 2.285,
              "f04": 2.951,
              "f05": 1.018,
              "f06": -0.59,
              "f07": 0.432,
              "f08": 1.614,
              "f09": -0.69,
              "f10": -1.27,
          },
          {
              "f01": 2.98,
              "f02": 3.74,
              "f03": 1.96,
              "f04": 0.80,
              "f05": 0.425,
              "f06": -0.76,
              "f07": 4.013,
              "f08": 3.119,
              "f09": 2.104,
              "f10": 0.195,
          },
          {
              "f01": 2.560,
              "f02": -2.05,
              "f03": 1.793,
              "f04": 0.955,
              "f05": 2.914,
              "f06": 2.239,
              "f07": -1.41,
              "f08": -1.24,
              "f09": -4.44,
              "f10": 0.273,
          },
          {
              "f01": 1.86,
              "f02": -0.017,
              "f03": 1.337,
              "f04": -2.14,
              "f05": 2.255,
              "f06": -1.21,
              "f07": -0.24,
              "f08": -0.66,
              "f09": -2.51,
              "f10": -1.06,
          },
          {
              "f01": -1.95,
              "f02": -1.81,
              "f03": 2.105,
              "f04": 0.976,
              "f05": -1.480,
              "f06": 1.120,
              "f07": -1.22,
              "f08": 0.704,
              "f09": -3.66,
              "f10": -1.72,
          },
          {
              "f01": -1.54,
              "f02": -2.17,
              "f03": -4.18,
              "f04": 1.708,
              "f05": 0.514,
              "f06": 0.354,
              "f07": -3.55,
              "f08": 2.285,
              "f09": -3.47,
              "f10": -0.79,
          },
          {
              "f01": 2.162,
              "f02": -0.71,
              "f03": -0.448,
              "f04": 0.326,
              "f05": 3.384,
              "f06": -0.455,
              "f07": 1.253,
              "f08": 0.998,
              "f09": 3.193,
              "f10": 1.342,
          },
      ]
      classes = [1, 1, 0, 2, 1, 2, 0, 1, 2, 1]
  
      rfeature_dicts = [
          {
              "f1": 1.351,
              "f2": -0.117,
              "f3": 0.570,
              "f4": 0.0619,
              "f5": 1.569,
              "f6": 0.805,
          },
          {
              "f1": -0.557,
              "f2": -1.704,
              "f3": 0.0913,
              "f4": 0.767,
              "f5": 1.281,
              "f6": -0.803,
          },
          {
              "f1": 0.720,
              "f2": -0.268,
              "f3": 0.760,
              "f4": 0.861,
              "f5": -0.403,
              "f6": 0.814,
          },
          {
              "f1": 1.737,
              "f2": -0.228,
              "f3": 1.340,
              "f4": 2.031,
              "f5": 2.170,
              "f6": 1.498,
          },
          {
              "f1": 0.344,
              "f2": 0.340,
              "f3": 0.572,
              "f4": -1.06,
              "f5": 1.044,
              "f6": 2.065,
          },
          {
              "f1": -0.489,
              "f2": -0.420,
              "f3": 0.428,
              "f4": 0.707,
              "f5": -1.306,
              "f6": 0.0081,
          },
          {
              "f1": 0.805,
              "f2": 0.570,
              "f3": 1.351,
              "f4": -0.117,
              "f5": 0.0619,
              "f6": 1.569,
          },
          {
              "f1": -1.083,
              "f2": 0.0369,
              "f3": -0.413,
              "f4": 1.391,
              "f5": 1.417,
              "f6": -1.118,
          },
          {
              "f1": -1.945,
              "f2": -0.332,
              "f3": -1.393,
              "f4": 0.952,
              "f5": -0.816,
              "f6": 1.417,
          },
          {
              "f1": 1.976,
              "f2": -0.220,
              "f3": -1.636,
              "f4": 0.795,
              "f5": -2.34,
              "f6": -0.148,
          },
      ]
      targets = [
          96.057,
          -176.017,
          -182.32,
          -56.46,
          -50.14,
          -84.53,
          241.71,
          -17.84,
          -47.09,
          77.65,
      ]
  
      # create training featuresets that we will use to train our estimator
      function_args_dict = defaultdict(dict)
      for estimator_type in ["classifier", "regressor"]:
          for do_feature_hashing in [True, False]:
              if estimator_type == "classifier":
                  (train_fs, test_fs) = make_classification_data(
                      num_examples=500,
                      num_features=10,
                      num_labels=3,
                      feature_bins=4,
                      non_negative=True,
                      use_feature_hashing=do_feature_hashing,
                  )
                  labels = classes
                  feature_dicts = cfeature_dicts
              else:
                  (train_fs, test_fs, _) = make_regression_data(
                      num_examples=500,
                      num_features=6,
                      feature_bins=4,
                      use_feature_hashing=do_feature_hashing,
                  )
                  labels = targets
                  feature_dicts = rfeature_dicts
  
              # if we are doing feature hashing, we need to transform our test
              # cases to the same space. If we are not, then we don't need to worry
              # beacuse we have manually ensured that the number of features are the
              # same for the non-hashing case (10 for classification, and 6 for
              # regression)
              test_fs = FeatureSet(
                  "test",
                  ids=list(range(1, 11)),
                  features=feature_dicts,
                  labels=labels,
                  vectorizer=train_fs.vectorizer
                  if do_feature_hashing
                  else None,
              )
              function_args_dict[estimator_type][do_feature_hashing] = [
                  train_fs,
                  test_fs,
                  feature_dicts,
                  labels,
              ]
      function_args_dict = dict(function_args_dict)
  
      # now set up the test cases
      learners = [
          "LinearSVC",
          "LogisticRegression",
          "MultinomialNB",
          "SVC",
          "GradientBoostingClassifier",
          "Lars",
          "LinearSVR",
          "Ridge",
          "SVR",
          "GradientBoostingRegressor",
      ]
      use_hashing = [True, False]
      min_feature_counts = [1, 2]
      samplers = [None, "RBFSampler", "SkewedChi2Sampler"]
      scalers = ["none", "with_mean", "with_std", "both"]
  
      for (
          learner_name,
          do_feature_hashing,
          min_count,
          scaling_type,
          sampler_name,
      ) in product(
          learners, use_hashing, min_feature_counts, scalers, samplers
      ):
          # skip the case for MultinomialNB with feature hashing
          # or feature sampling since it does not support those
          if learner_name == "MultinomialNB":
              if do_feature_hashing or sampler_name is not None:
                  continue
  
          # if we are using a SkewedChi2Sampler, we need to set the
          # some parameters to make sure it works as expected
          if sampler_name == "SkewedChi2Sampler":
              sampler_kwargs = {"skewedness": 15, "n_components": 10}
          else:
              sampler_kwargs = {}
  
          # create a learner instance with the given parameters
          # and with pipeline attribute set to True
          learner = Learner(
              learner_name,
              min_feature_count=min_count,
              sampler=sampler_name,
              sampler_kwargs=sampler_kwargs,
              feature_scaling=scaling_type,
              pipeline=True,
          )
  
          yield self.check_pipeline_attribute, do_feature_hashing, learner, function_args_dict
  
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 23 for calling the TestOutput obj's underlying member method code with example usage: obj.test_pipeline_attribute() without return types