class_docstr: Test class for first set of voting learner API tests.
docstr: Run checks for voting learner initialization.
docstr_tok: ["Run","checks","for","voting","learner","initialization","."]
code: def check_initialize(
      self,
      learner_type,
      voting_type,
      feature_scaling,
      pos_label,
      min_feature_count,
      model_kwargs_list,
      sampler_list,
  ):
      """Run checks for voting learner initialization."""
      # instantiate the keyword arguments for the initialization
      kwargs = {}
      if voting_type:
          kwargs["voting"] = voting_type
      if feature_scaling:
          kwargs["feature_scaling"] = feature_scaling
      if pos_label:
          kwargs["pos_label"] = pos_label
      if min_feature_count:
          kwargs["min_feature_count"] = min_feature_count
      if sampler_list is not None:
          sampler_list = [
              "RBFSampler",
              "Nystroem",
              "AdditiveChi2Sampler",
          ]
          kwargs["sampler_list"] = sampler_list
  
      # if the voting learner is a classifier
      if learner_type == "classifier":
          # we are using 2 learners
          learner_names = ["LogisticRegression", "SVC", "MultinomialNB"]
  
          # add the model parameters for each of the learners
          if model_kwargs_list is not None:
              given_model_kwargs_list = [
                  {"C": 0.01},
                  {"C": 10.0, "kernel": "poly"},
                  {"alpha": 0.75},
              ]
              kwargs["model_kwargs_list"] = given_model_kwargs_list
      else:
          # we are using 2 learners
          learner_names = [
              "LinearRegression",
              "SVR",
              "RandomForestRegressor",
          ]
  
          # add the model parameters for each of the learners
          if model_kwargs_list is not None:
              given_model_kwargs_list = [
                  {},
                  {"C": 0.01, "kernel": "linear"},
                  {"n_estimators": 1000},
              ]
              kwargs["model_kwargs_list"] = given_model_kwargs_list
  
      # initialize the voting classifier
      vl = VotingLearner(learner_names, **kwargs)
  
      # check that we have the right number and type of learners
      self.assertEqual(len(vl.learners), len(learner_names))
      self.assertEqual(
          vl.learners[0].model_type.__name__, learner_names[0]
      )
      self.assertEqual(
          vl.learners[1].model_type.__name__, learner_names[1]
      )
      self.assertEqual(
          vl.learners[2].model_type.__name__, learner_names[2]
      )
  
      # check that the probability attribute is properly set
      if learner_type == "classifier":
          self.assertEqual(
              vl.learners[0].probability, voting_type == "soft"
          )
          self.assertEqual(
              vl.learners[1].probability, voting_type == "soft"
          )
          self.assertEqual(
              vl.learners[2].probability, voting_type == "soft"
          )
  
      # check that we have the right attribute values
      self.assertEqual(vl.learner_type, learner_type)
      self.assertEqual(vl.label_dict, {})
  
      # check that voting type is properly set
      if learner_type == "classifier":
          expected_voting_type = (
              "hard" if voting_type is None else voting_type
          )
      else:
          expected_voting_type = None
      self.assertEqual(vl.voting, expected_voting_type)
  
      # check that feature scaling is properly set
      expected_feature_scaling = (
          "none" if feature_scaling is None else feature_scaling
      )
      self.assertEqual(
          vl.learners[0]._feature_scaling, expected_feature_scaling
      )
      self.assertEqual(
          vl.learners[1]._feature_scaling, expected_feature_scaling
      )
      self.assertEqual(
          vl.learners[2]._feature_scaling, expected_feature_scaling
      )
  
      # check that any given model kwargs are reflected
      if model_kwargs_list:
          self.assertEqual(
              vl.model_kwargs_list, given_model_kwargs_list
          )
          if learner_type == "classifier":
              self.assertEqual(
                  vl.learners[0].model_kwargs["C"],
                  given_model_kwargs_list[0]["C"],
              )
              self.assertEqual(
                  vl.learners[1].model_kwargs["C"],
                  given_model_kwargs_list[1]["C"],
              )
              self.assertEqual(
                  vl.learners[1].model_kwargs["kernel"],
                  given_model_kwargs_list[1]["kernel"],
              )
              self.assertEqual(
                  vl.learners[2].model_kwargs["alpha"],
                  given_model_kwargs_list[2]["alpha"],
              )
          else:
              self.assertEqual(
                  vl.learners[1].model_kwargs["C"],
                  given_model_kwargs_list[1]["C"],
              )
              self.assertEqual(
                  vl.learners[1].model_kwargs["kernel"],
                  given_model_kwargs_list[1]["kernel"],
              )
              self.assertEqual(
                  vl.learners[2].model_kwargs["n_estimators"],
                  given_model_kwargs_list[2]["n_estimators"],
              )
      else:
          self.assertEqual(vl.model_kwargs_list, [])
  
      # check that any given samplers are actually used
      if sampler_list:
          self.assertEqual(vl.sampler_list, sampler_list)
          self.assertEqual(
              vl.learners[0].sampler.__class__.__name__, "RBFSampler"
          )
          self.assertEqual(
              vl.learners[1].sampler.__class__.__name__, "Nystroem"
          )
          self.assertEqual(
              vl.learners[2].sampler.__class__.__name__,
              "AdditiveChi2Sampler",
          )
      else:
          self.assertEqual(vl.sampler_list, [])
  
      # check that sampler kwargs is reflected
      self.assertEqual(vl.sampler_kwargs_list, [])
  
imports: import unittest
  from itertools import product
  from pathlib import Path
  import numpy
  from numpy.testing import assert_raises_regex
  from sklearn.ensemble import RandomForestRegressor, VotingClassifier, VotingRegressor
  from sklearn.linear_model import LinearRegression, LogisticRegression
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.pipeline import Pipeline
  from sklearn.svm import SVC, SVR
  from skll.learner.voting import VotingLearner
  from skll.utils.testing import make_california_housing_data, make_digits_data, other_dir, output_dir
label_desc: Use image node_id 3 for calling the TestVotingLearnersAPIOne obj's underlying member method code with example usage: obj.check_initialize(learner_type, voting_type, feature_scaling, pos_label, min_feature_count, model_kwargs_list, sampler_list) without return types