code: def get_model_name(model):
      """
      Detects the model name for a Scikit-Learn model or pipeline.
  
      Parameters
      ----------
      model: class or instance
          The object to determine the name for. If the model is an estimator it
          returns the class name; if it is a Pipeline it returns the class name
          of the final transformer or estimator in the Pipeline.
  
      Returns
      -------
      name : string
          The name of the model or pipeline.
      """
      if not is_estimator(model):
          raise YellowbrickTypeError(
              "Cannot detect the model name for non estimator: '{}'".format(
                  type(model)
              )
          )
  
      if isinstance(model, Pipeline):
          return get_model_name(model.steps[-1][-1])
      elif isinstance(model, ContribEstimator):
          return model.estimator.__class__.__name__
      else:
          return model.__class__.__name__
  
file_path: yellowbrick/yellowbrick/utils/helpers.py
imports: import re
  import inspect
  import sklearn
  import numpy
  from sklearn.pipeline import Pipeline
  from sklearn.utils.validation import check_is_fitted
  from yellowbrick.utils.types import is_estimator
  from yellowbrick.exceptions import YellowbrickTypeError
  from yellowbrick.contrib.wrapper import ContribEstimator
label_desc: Use image node_id 3 for calling a global function with example usage: get_model_name(model) and returns: get_model_name, model, model