class_docstr: Unit test class for testing scikit-learn converter.
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","."]
code: def test_int_features_in_pipeline(self):
      import numpy.random as rn
      import pandas as pd
  
      rn.seed(0)
  
      x_train_dict = [
          dict((rn.randint(100), 1) for i in range(20))
          for j in range(100)
      ]
      y_train = [0, 1] * 50
  
      from sklearn.pipeline import Pipeline
      from sklearn.feature_extraction import DictVectorizer
      from sklearn.linear_model import LogisticRegression
  
      pl = Pipeline(
          [("dv", DictVectorizer()), ("lm", LogisticRegression())]
      )
      pl.fit(x_train_dict, y_train)
  
      import coremltools
  
      model = coremltools.converters.sklearn.convert(
          pl, input_features="features", output_feature_names="target"
      )
  
      if _is_macos() and _macos_version() >= (10, 13):
          x = pd.DataFrame(
              {
                  "features": x_train_dict,
                  "prediction": pl.predict(x_train_dict),
              }
          )
  
          cur_eval_metics = evaluate_classifier(model, x)
          self.assertEquals(cur_eval_metics["num_errors"], 0)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/test/sklearn_tests/test_dict_vectorizer.py
imports: import unittest
  from coremltools._deps import _HAS_SKLEARN
  from copy import copy
  import numpy
  from coremltools.models.utils import evaluate_transformer
  from coremltools.models.utils import evaluate_classifier
  from coremltools.models.utils import _macos_version, _is_macos
label_desc: Use image node_id 4 for calling the DictVectorizerScikitTest obj's underlying member method code with example usage: obj.test_int_features_in_pipeline() without return types