code: def create_model(
      model: Union[str, Any],
      num_clusters: int = 4,
      ground_truth: Optional[str] = None,
      round: int = 4,
      fit_kwargs: Optional[dict] = None,
      verbose: bool = True,
      experiment_custom_tags: Optional[Dict[str, Any]] = None,
      engine: Optional[str] = None,
      **kwargs,
  ):
      """
      This function trains and evaluates the performance of a given model.
      Metrics evaluated can be accessed using the ``get_metrics`` function.
      Custom metrics can be added or removed using the ``add_metric`` and
      ``remove_metric`` function. All the available models can be accessed
      using the ``models`` function.
  
  
      Example
      -------
      >>> from pycaret.datasets import get_data
      >>> jewellery = get_data('jewellery')
      >>> from pycaret.clustering import *
      >>> exp_name = setup(data = jewellery)
      >>> kmeans = create_model('kmeans')
  
  
      model: str or scikit-learn compatible object
          ID of an model available in the model library or pass an untrained
          model object consistent with scikit-learn API. Models available
          in the model library (ID - Name):
  
          * 'kmeans' - K-Means Clustering
          * 'ap' - Affinity Propagation
          * 'meanshift' - Mean shift Clustering
          * 'sc' - Spectral Clustering
          * 'hclust' - Agglomerative Clustering
          * 'dbscan' - Density-Based Spatial Clustering
          * 'optics' - OPTICS Clustering
          * 'birch' - Birch Clustering
          * 'kmodes' - K-Modes Clustering
  
  
      num_clusters: int, default = 4
          The number of clusters to form.
  
  
      ground_truth: str, default = None
          ground_truth to be provided to evaluate metrics that require true labels.
          When None, such metrics are returned as 0.0. All metrics evaluated can
          be accessed using ``get_metrics`` function.
  
  
      round: int, default = 4
          Number of decimal places the metrics in the score grid will be rounded to.
  
  
      fit_kwargs: dict, default = {} (empty dict)
          Dictionary of arguments passed to the fit method of the model.
  
  
      verbose: bool, default = True
          Status update is not printed when verbose is set to False.
  
  
      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 K-Means Clustering ("kmeans"), users can
          switch between "sklearn" and "sklearnex" by specifying
          `engine="sklearnex"`.
  
  
      **kwargs:
          Additional keyword arguments to pass to the estimator.
  
  
      Returns:
          Trained Model
  
  
      Warnings
      --------
      - ``num_clusters`` param not required for Affinity Propagation ('ap'),
        Mean shift ('meanshift'), Density-Based Spatial Clustering ('dbscan')
        and OPTICS Clustering ('optics').
  
      - When fit doesn't converge in Affinity Propagation ('ap') model, all
        datapoints are labelled as -1.
  
      - Noisy samples are given the label -1, when using Density-Based Spatial
        ('dbscan') or OPTICS Clustering ('optics').
  
      - OPTICS ('optics') clustering may take longer training times on large
        datasets.
  
  
      """
  
      return _CURRENT_EXPERIMENT.create_model(
          estimator=model,
          num_clusters=num_clusters,
          ground_truth=ground_truth,
          round=round,
          fit_kwargs=fit_kwargs,
          verbose=verbose,
          experiment_custom_tags=experiment_custom_tags,
          engine=engine,
          **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.clustering.oop import ClusteringExperiment
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE
  from pycaret.utils.generic import check_if_global_is_not_none
label_desc: Use image node_id 4 for calling a global function with example usage: create_model(model, num_clusters, ground_truth, round, fit_kwargs, verbose, experiment_custom_tags, engine) and returns: _CURRENT_EXPERIMENT