code: def log_model(
      self,
      experiment: "_TabularExperiment",
      model,
      model_results,
      pipeline,
      score_dict: dict,
      source: str,
      runtime: float,
      model_fit_time: float,
      log_holdout: bool = True,
      log_plots: Optional[List[str]] = None,
      experiment_custom_tags: Optional[Dict[str, Any]] = None,
      tune_cv_results=None,
      URI=None,
      display=None,
  ):
      log_plots = log_plots or []
      console = experiment.logger
      console.info("Creating Dashboard logs")
  
      # Creating Logs message monitor
      if display:
          display.update_monitor(1, "Creating Logs")
  
      full_name = experiment._get_model_name(model)
      console.info(f"Model: {full_name}")
      self.init_loggers(experiment.exp_name_log, full_name, setup=False)
  
      # Log model parameters
      pipeline_estimator_name = get_pipeline_estimator_label(model)
      if pipeline_estimator_name:
          params = model.named_steps[pipeline_estimator_name]
      else:
          params = model
  
      # get regressor from meta estimator
      params = get_estimator_from_meta_estimator(params)
  
      try:
          try:
              params = params.get_all_params()
          except AttributeError:
              params = params.get_params()
      except Exception:
          console.warning(
              f"Couldn't get params for model. Exception:\n{traceback.format_exc()}"
          )
          params = {}
  
      for i in list(params):
          v = params.get(i)
          if len(str(v)) > 250:
              params.pop(i)
  
      console.info(f"Logged params: {params}")
      score_dict["TT"] = model_fit_time
  
      # Log metrics
      def try_make_float(val):
          try:
              return np.float64(val)
          except Exception:
              return np.nan
  
      score_dict = {k: try_make_float(v) for k, v in score_dict.items()}
  
      for logger in self.loggers:
          logger.log_params(params, model_name=full_name)
          logger.log_metrics(score_dict, source)
          logger.set_tags(
              source,
              experiment_custom_tags,
              runtime,
              USI=experiment.USI,
          )
  
      with tempfile.TemporaryDirectory() as tmpdir:
          # Log the CV results as model_results.html artifact
          if (
              not experiment._is_unsupervised()
              and model_results is not None
          ):
              results_path = os.path.join(tmpdir, "Results.html")
              try:
                  model_results.data.to_html(
                      results_path, col_space=65, justify="left"
                  )
              except Exception:
                  model_results.to_html(
                      results_path, col_space=65, justify="left"
                  )
              [
                  logger.log_artifact(results_path, "Results")
                  for logger in self.loggers
              ]
  
              if log_holdout:
                  # Generate hold-out predictions and save as html
                  holdout_path = os.path.join(tmpdir, "Holdout.html")
                  try:
                      experiment.predict_model(model, verbose=False)  # type: ignore
                      holdout_score = experiment.pull(pop=True)
                      holdout_score.to_html(
                          holdout_path, col_space=65, justify="left"
                      )
                      [
                          logger.log_artifact(holdout_path, "Holdout")
                          for logger in self.loggers
                      ]
                  except Exception:
                      console.warning(
                          "Couldn't create holdout prediction for model, exception below:\n"
                          f"{traceback.format_exc()}"
                      )
  
          # Log AUC and Confusion Matrix plot
  
          if log_plots:
              console.info(
                  "SubProcess plot_model() called =================================="
              )
  
              def _log_plot(plot):
                  try:
                      plot_name = experiment._plot_model(
                          model,
                          plot=plot,
                          verbose=False,
                          save=tmpdir,
                          system=False,
                      )
                      [
                          logger.log_plot(
                              plot_name, Path(plot_name).stem
                          )
                          for logger in self.loggers
                      ]
                  except Exception:
                      console.warning(
                          f"Couldn't create plot {plot} for model, exception below:\n"
                          f"{traceback.format_exc()}"
                      )
  
              for plot in log_plots:
                  _log_plot(plot)
  
              console.info(
                  "SubProcess plot_model() end =================================="
              )
  
          # Log hyperparameter tuning grid
          if tune_cv_results:
              iterations_path = os.path.join(tmpdir, "Iterations.html")
              d1 = tune_cv_results.get("params")
              dd = pd.DataFrame.from_dict(d1)
              dd["Score"] = tune_cv_results.get("mean_test_score")
              dd.to_html(iterations_path, col_space=75, justify="left")
              [
                  logger.log_hpram_grid(
                      iterations_path, "Hyperparameter-grid"
                  )
                  for logger in self.loggers
              ]
  
          [
              logger.log_sklearn_pipeline(
                  experiment, pipeline, model, path=tmpdir
              )
              for logger in self.loggers
          ]
  
      self.finish()
      gc.collect()
  
file_path: pycaret/pycaret/loggers/dashboard_logger.py
imports: import gc
  import os
  import tempfile
  import traceback
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Dict, List, Optional
  import numpy
  import pandas
  from pycaret.internal.meta_estimators import get_estimator_from_meta_estimator
  from pycaret.internal.pipeline import get_pipeline_estimator_label
  from .base_logger import SETUP_TAG, BaseLogger
label_desc: Use image node_id 5 for calling the DashboardLogger obj's underlying member method code with example usage: obj.log_model(experiment, model, model_results, pipeline, score_dict, source, runtime, model_fit_time, log_holdout, log_plots, experiment_custom_tags, tune_cv_results, URI, display) and returns: np, np