code: def finalize_model(
      estimator,
      fit_kwargs: Optional[dict] = None,
      groups: Optional[Union[str, Any]] = None,
      model_only: bool = False,
      experiment_custom_tags: Optional[Dict[str, Any]] = None,
  ) -> Any:
      """
      This function trains a given estimator on the entire dataset including the
      holdout set.
  
  
      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')
      >>> final_lr = finalize_model(lr)
  
  
      estimator: scikit-learn compatible object
          Trained model object
  
  
      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.
  
  
      model_only : bool, default = False
          Whether to return the complete fitted pipeline or only the fitted model.
  
  
      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.
  
  
      Returns:
          Trained pipeline or model object fitted on complete dataset.
  
  
      """
  
      return _CURRENT_EXPERIMENT.finalize_model(
          estimator=estimator,
          fit_kwargs=fit_kwargs,
          groups=groups,
          model_only=model_only,
          experiment_custom_tags=experiment_custom_tags,
      )
  
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 14 for calling a global function with example usage: finalize_model(estimator, fit_kwargs, groups, model_only, experiment_custom_tags) and returns: _CURRENT_EXPERIMENT