code: def create_model(
      estimator: Union[str, Any],
      fold: Optional[Union[int, Any]] = None,
      round: int = 4,
      cross_validation: bool = True,
      fit_kwargs: Optional[dict] = None,
      groups: Optional[Union[str, Any]] = None,
      experiment_custom_tags: Optional[Dict[str, Any]] = None,
      engine: Optional[str] = None,
      verbose: bool = True,
      return_train_score: bool = False,
      **kwargs,
  ):
      """
      This function trains and evaluates the performance of a given estimator
      using cross validation. The output of this function is a score grid with
      CV scores by fold. Metrics evaluated during CV can be accessed using the
      ``get_metrics`` function. Custom metrics can be added or removed using
      ``add_metric`` and ``remove_metric`` function. All the available models
      can be accessed using the ``models`` function.
  
  
      Example
      -------
      >>> from pycaret.datasets import get_data
      >>> boston = get_data('boston')
      >>> from pycaret.regression import *
      >>> exp_name = setup(data = boston,  target = 'medv')
      >>> lr = create_model('lr')
  
  
      estimator: str or scikit-learn compatible object
          ID of an estimator available in model library or pass an untrained
          model object consistent with scikit-learn API. Estimators available
          in the model library (ID - Name):
  
          * 'lr' - Linear Regression
          * 'lasso' - Lasso Regression
          * 'ridge' - Ridge Regression
          * 'en' - Elastic Net
          * 'lar' - Least Angle Regression
          * 'llar' - Lasso Least Angle Regression
          * 'omp' - Orthogonal Matching Pursuit
          * 'br' - Bayesian Ridge
          * 'ard' - Automatic Relevance Determination
          * 'par' - Passive Aggressive Regressor
          * 'ransac' - Random Sample Consensus
          * 'tr' - TheilSen Regressor
          * 'huber' - Huber Regressor
          * 'kr' - Kernel Ridge
          * 'svm' - Support Vector Regression
          * 'knn' - K Neighbors Regressor
          * 'dt' - Decision Tree Regressor
          * 'rf' - Random Forest Regressor
          * 'et' - Extra Trees Regressor
          * 'ada' - AdaBoost Regressor
          * 'gbr' - Gradient Boosting Regressor
          * 'mlp' - MLP Regressor
          * 'xgboost' - Extreme Gradient Boosting
          * 'lightgbm' - Light Gradient Boosting Machine
          * 'catboost' - CatBoost Regressor
  
  
      fold: int or scikit-learn compatible CV generator, default = None
          Controls cross-validation. If None, the CV generator in the ``fold_strategy``
          parameter of the ``setup`` function is used. When an integer is passed,
          it is interpreted as the 'n_splits' parameter of the CV generator in the
          ``setup`` function.
  
  
      round: int, default = 4
          Number of decimal places the metrics in the score grid will be rounded to.
  
  
      cross_validation: bool, default = True
          When set to False, metrics are evaluated on holdout set. ``fold`` param
          is ignored when cross_validation is set to False.
  
  
      fit_kwargs: dict, default = {} (empty dict)
          Dictionary of arguments passed to the fit method of the model.
  
  
      groups: str or array-like, with shape (n_samples,), default = None
          Optional group labels when GroupKFold is used for the cross validation.
          It takes an array with shape (n_samples, ) where n_samples is the number
          of rows in training dataset. When string is passed, it is interpreted as
          the column name in the dataset containing group labels.
  
  
      experiment_custom_tags: dict, default = None
          Dictionary of tag_name: String -> value: (String, but will be string-ified
          if not) passed to the mlflow.set_tags to add new custom tags for the experiment.
  
  
      engine: Optional[str] = None
          The execution engine to use for the model, e.g. for Linear Regression ("lr"), users can
          switch between "sklearn" and "sklearnex" by specifying
          `engine="sklearnex"`.
  
  
      verbose: bool, default = True
          Score grid is not printed when verbose is set to False.
  
  
      return_train_score: bool, default = False
          If False, returns the CV Validation scores only.
          If True, returns the CV training scores along with the CV validation scores.
          This is useful when the user wants to do bias-variance tradeoff. A high CV
          training score with a low corresponding CV validation score indicates overfitting.
  
  
      **kwargs:
          Additional keyword arguments to pass to the estimator.
  
  
      Returns:
          Trained Model
  
  
      Warnings
      --------
      - Models are not logged on the ``MLFlow`` server when ``cross_validation`` param
        is set to False.
  
      """
  
      return _CURRENT_EXPERIMENT.create_model(
          estimator=estimator,
          fold=fold,
          round=round,
          cross_validation=cross_validation,
          fit_kwargs=fit_kwargs,
          groups=groups,
          experiment_custom_tags=experiment_custom_tags,
          engine=engine,
          verbose=verbose,
          return_train_score=return_train_score,
          **kwargs,
      )
  
imports: import logging
  import os
  from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
  import pandas
  from joblib.memory import Memory
  from pycaret.internal.parallel.parallel_backend import ParallelBackend
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.regression.oop import RegressionExperiment
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE, TARGET_LIKE
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 5 for calling a global function with example usage: create_model(estimator, fold, round, cross_validation, fit_kwargs, groups, experiment_custom_tags, engine, verbose, return_train_score) and returns: _CURRENT_EXPERIMENT