docstr: This function saves the transformation pipeline and trained model object
  into the current working directory as a pickle file for later use.
  
  Example
  -------
  >>> from pycaret.datasets import get_data
  >>> juice = get_data('juice')
  >>> from pycaret.classification import *
  >>> exp_name = setup(data = juice,  target = 'Purchase')
  >>> lr = create_model('lr')
  >>> save_model(lr, 'saved_lr_model')
  
  
  model: scikit-learn compatible object
      Trained model object
  
  
  model_name: str
      Name of the model.
  
  
  model_only: bool, default = False
      When set to True, only trained model object is saved instead of the
      entire pipeline.
  
  
  verbose: bool, default = True
      Success message is not printed when verbose is set to False.
  
  
  **kwargs:
      Additional keyword arguments to pass to joblib.dump().
  
  
  Returns:
      Tuple of the model object and the filename.
docstr_tok: ["This","function","saves","the","transformation","pipeline","and","trained","model","object","into","the","current","working","directory","as","a","pickle","file","for","later","use",".","Example","--","--","--","-",">",">",">","from","pycaret.datasets","import","get_data",">",">",">","juice","=","get_data","(","'juice","'",")",">",">",">","from","pycaret.classification","import","*",">",">",">","exp_name","=","setup","(","data","=","juice",",","target","=","'Purchase","'",")",">",">",">","lr","=","create_model","(","'lr","'",")",">",">",">","save_model","(","lr",",","'saved_lr_model","'",")","model",":","scikit-learn","compatible","object","Trained","model","object","model_name",":","str","Name","of","the","model",".","model_only",":","bool",",","default","=","False","When","set","to","True",",","only","trained","model","object","is","saved","instead","of","the","entire","pipeline",".","verbose",":","bool",",","default","=","True","Success","message","is","not","printed","when","verbose","is","set","to","False",".","*","*","kwargs",":","Additional","keyword","arguments","to","pass","to","joblib.dump","(",")",".","Returns",":","Tuple","of","the","model","object","and","the","filename","."]
code: def save_model(
      self,
      model,
      model_name: str,
      model_only: bool = False,
      verbose: bool = True,
      **kwargs,
  ):
      """
      This function saves the transformation pipeline and trained model object
      into the current working directory as a pickle file for later use.
  
      Example
      -------
      >>> from pycaret.datasets import get_data
      >>> juice = get_data('juice')
      >>> from pycaret.classification import *
      >>> exp_name = setup(data = juice,  target = 'Purchase')
      >>> lr = create_model('lr')
      >>> save_model(lr, 'saved_lr_model')
  
  
      model: scikit-learn compatible object
          Trained model object
  
  
      model_name: str
          Name of the model.
  
  
      model_only: bool, default = False
          When set to True, only trained model object is saved instead of the
          entire pipeline.
  
  
      verbose: bool, default = True
          Success message is not printed when verbose is set to False.
  
  
      **kwargs:
          Additional keyword arguments to pass to joblib.dump().
  
  
      Returns:
          Tuple of the model object and the filename.
  
      """
  
      return super().save_model(
          model=model,
          model_name=model_name,
          model_only=model_only,
          verbose=verbose,
          **kwargs,
      )
  
imports: import datetime
  import gc
  import logging
  import re
  import time
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from unittest.mock import patch
  import numpy
  import pandas
  import plotly.express
  import sklearn
  from joblib.memory import Memory
  from scipy.optimize import shgo
  from pycaret.containers.metrics.classification import get_all_metric_containers
  from pycaret.containers.models.classification import ALL_ALLOWED_ENGINES, get_all_model_containers, get_container_default_engines
  from pycaret.internal.display import CommonDisplay
  from pycaret.internal.logging import get_logger
  from pycaret.internal.meta_estimators import CustomProbabilityThresholdClassifier, get_estimator_from_meta_estimator
  from pycaret.internal.parallel.parallel_backend import ParallelBackend
  from pycaret.internal.pipeline import Pipeline
  from pycaret.internal.preprocess.preprocessor import Preprocessor
  from pycaret.internal.pycaret_experiment.non_ts_supervised_experiment import _NonTSSupervisedExperiment
  from pycaret.internal.validation import is_sklearn_cv_generator
  from pycaret.loggers.base_logger import BaseLogger
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE, TARGET_LIKE
  from pycaret.utils.generic import MLUsecase, get_classification_task, get_label_encoder, highlight_setup
label_desc: Use image node_id 21 for calling the ClassificationExperiment obj's underlying member method code with example usage: obj.save_model(model, model_name, model_only, verbose) and returns: super