code: def _conversion_and_evaluation_helper_for_logistic_regression(
      self, class_labels
  ):
      options = {
          "C": (0.1, 1.0, 2.0),
          "fit_intercept": (True, False),
          "class_weight": ("balanced", None),
          "solver": ("newton-cg", "lbfgs", "liblinear", "sag"),
      }
  
      # Generate a list of all combinations of options and the default parameters
      product = itertools.product(*options.values())
      args = [{}] + [dict(zip(options.keys(), p)) for p in product]
  
      x, y = GlmCassifierTest._generate_random_data(class_labels)
      column_names = ["x1", "x2"]
      df = pd.DataFrame(x, columns=column_names)
  
      for cur_args in args:
          # multi_class default changed in version 0.22 from ‘ovr’ to ‘auto’ in 0.22.
          # Specify explicitly to match <0.22 behavior.
          cur_model = LogisticRegression(**cur_args, multi_class="ovr")
          cur_model.fit(x, y)
  
          spec = convert(
              cur_model,
              input_features=column_names,
              output_feature_names="target",
          )
  
          if _is_macos() and _macos_version() >= (10, 13):
              probability_lists = cur_model.predict_proba(x)
              df["classProbability"] = [
                  dict(zip(cur_model.classes_, cur_vals))
                  for cur_vals in probability_lists
              ]
  
              metrics = evaluate_classifier_with_probabilities(
                  spec,
                  df,
                  probabilities="classProbability",
                  verbose=False,
              )
              self.assertEqual(metrics["num_key_mismatch"], 0)
              self.assertLess(metrics["max_probability_error"], 0.00001)
  
file_path: coremltools/coremltools/test/sklearn_tests/test_glm_classifier.py
imports: import itertools
  import random
  import unittest
  import pandas
  from coremltools._deps import _HAS_SKLEARN
  from coremltools.converters.sklearn import convert
  from coremltools.models.utils import _is_macos, _macos_version, evaluate_classifier, evaluate_classifier_with_probabilities
label_desc: Use image node_id 4 for calling the GlmCassifierTest obj's underlying member method code with example usage: obj._conversion_and_evaluation_helper_for_logistic_regression(class_labels) without return types