class_docstr: Unit test class for testing scikit-learn converter and running both models
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","and","running","both","models"]
docstr: Train a scikit-learn model, convert it and then evaluate it with CoreML
docstr_tok: ["Train","a","scikit-learn","model",",","convert","it","and","then","evaluate","it","with","CoreML"]
code: def _train_convert_evaluate_assert(self, **scikit_params):
      """
      Train a scikit-learn model, convert it and then evaluate it with CoreML
      """
      scikit_model = DecisionTreeRegressor(
          random_state=1, **scikit_params
      )
      scikit_model.fit(self.X, self.target)
  
      # Convert the model
      spec = skl_converter.convert(
          scikit_model, self.feature_names, self.output_name
      )
  
      if _is_macos() and _macos_version() >= (10, 13):
          # Get predictions
          df = pd.DataFrame(self.X, columns=self.feature_names)
          df["prediction"] = scikit_model.predict(self.X)
  
          # Evaluate it
          metrics = evaluate_regressor(
              spec, df, target="target", verbose=False
          )
          self._check_metrics(metrics, scikit_params)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/test/xgboost_tests/test_decision_tree_regression_numeric.py
imports: import unittest
  from coremltools.converters import sklearn
  from coremltools.models.utils import evaluate_regressor
  import pandas
  import os
  from coremltools.models.utils import evaluate_regressor, _macos_version, _is_macos
  from coremltools._deps import _HAS_SKLEARN
  import pytest
label_desc: Use image node_id 3 for calling the DecisionTreeRegressorBostonHousingScikitNumericTest obj's underlying member method code with example usage: obj._train_convert_evaluate_assert() without return types