class_docstr: Unit test class for testing scikit-learn converter.
code: def test_conversion_boston(self):
      from sklearn.datasets import load_boston
  
      scikit_data = load_boston()
  
      sh = scikit_data.data.shape
  
      rn.seed(0)
      missing_value_indices = [
          (rn.randint(sh[0]), rn.randint(sh[1])) for k in range(sh[0])
      ]
  
      for strategy in ["mean", "median", "most_frequent"]:
          for missing_value in [0, "NaN", -999]:
              # SimpleImputer >=0.22 does not accept missing values encoded as NaN.
              if _SKLEARN_VERSION >= StrictVersion("0.22"):
                  if missing_value == "NaN":
                      continue
  
              X = np.array(scikit_data.data).copy()
  
              for i, j in missing_value_indices:
                  X[i, j] = missing_value
  
              model = Imputer(
                  missing_values=missing_value, strategy=strategy
              )
              model = model.fit(X)
  
              tr_X = model.transform(X.copy())
  
              spec = converter.convert(
                  model, scikit_data.feature_names, "out"
              )
  
              input_data = [
                  dict(zip(scikit_data.feature_names, row)) for row in X
              ]
  
              output_data = [{"out": row} for row in tr_X]
  
              result = evaluate_transformer(
                  spec, input_data, output_data
              )
  
              assert result["num_errors"] == 0
  
file_path: coremltools/coremltools/test/sklearn_tests/test_imputer.py
imports: import unittest
  from distutils.version import StrictVersion
  import numpy
  import numpy.random
  from coremltools._deps import _HAS_SKLEARN, _SKLEARN_VERSION
  from coremltools.models.utils import _is_macos, _macos_version, evaluate_transformer
label_desc: Use image node_id 1 for calling the NumericalImputerTestCase obj's underlying member method code with example usage: obj.test_conversion_boston() without return types