code: def convert(model, feature_names, target):
      """Convert a Logistic Regression model to the protobuf spec.
      Parameters
      ----------
      model: LogisticRegression
          A trained LogisticRegression model.
  
      feature_names: [str], optional (default=None)
          Name of the input columns.
  
      target: str, optional (default=None)
          Name of the output column.
  
      Returns
      -------
      model_spec: An object of type Model_pb.
          Protobuf representation of the model
      """
      if not (_HAS_SKLEARN):
          raise RuntimeError(
              "scikit-learn not found. scikit-learn conversion API is disabled."
          )
  
      _sklearn_util.check_expected_type(model, LogisticRegression)
      _sklearn_util.check_fitted(model, lambda m: hasattr(m, "coef_"))
  
      return _MLModel(_convert(model, feature_names, target))
  
file_path: coremltools/coremltools/converters/sklearn/_logistic_regression.py
imports: from collections.abc import Iterable
  from ..._deps import _HAS_SKLEARN
  from ...models import MLModel
  from ...None import SPECIFICATION_VERSION
  from ...models._interface_management import set_classifier_interface_params
  from ...proto import Model_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: convert(model, feature_names, target) and returns: _MLModel