docstr: This function analyzes the performance of a trained model on holdout set.
  It may require re-training the model in certain cases.
  
  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')
  >>> plot_model(lr, plot = 'auc')
  
  
  estimator: scikit-learn compatible object
      Trained model object
  
  
  plot: str, default = 'auc'
      List of available plots (ID - Name):
  
      * 'pipeline' - Schematic drawing of the preprocessing pipeline
      * 'auc' - Area Under the Curve
      * 'threshold' - Discrimination Threshold
      * 'pr' - Precision Recall Curve
      * 'confusion_matrix' - Confusion Matrix
      * 'error' - Class Prediction Error
      * 'class_report' - Classification Report
      * 'boundary' - Decision Boundary
      * 'rfe' - Recursive Feature Selection
      * 'learning' - Learning Curve
      * 'manifold' - Manifold Learning
      * 'calibration' - Calibration Curve
      * 'vc' - Validation Curve
      * 'dimension' - Dimension Learning
      * 'feature' - Feature Importance
      * 'feature_all' - Feature Importance (All)
      * 'parameter' - Model Hyperparameter
      * 'lift' - Lift Curve
      * 'gain' - Gain Chart
      * 'tree' - Decision Tree
      * 'ks' - KS Statistic Plot
  
  
  scale: float, default = 1
      The resolution scale of the figure.
  
  
  save: bool, default = False
      When set to True, plot is saved in the current working directory.
  
  
  fold: int or scikit-learn compatible CV generator, default = None
      Controls cross-validation. If None, the CV generator in the ``fold_strategy``
      parameter of the ``setup`` function is used. When an integer is passed,
      it is interpreted as the 'n_splits' parameter of the CV generator in the
      ``setup`` function.
  
  
  fit_kwargs: dict, default = {} (empty dict)
      Dictionary of arguments passed to the fit method of the model.
  
  
  plot_kwargs: dict, default = {} (empty dict)
      Dictionary of arguments passed to the visualizer class.
          - pipeline: fontsize -> int
  
  
  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.
  
  
  verbose: bool, default = True
      When set to False, progress bar is not displayed.
  
  
  display_format: str, default = None
      To display plots in Streamlit (https://www.streamlit.io/), set this to 'streamlit'.
      Currently, not all plots are supported.
  
  
  Returns:
      Path to saved file, if any.
  
  
  Warnings
  --------
  -   Estimators that does not support 'predict_proba' attribute cannot be used for
      'AUC' and 'calibration' plots.
  
  -   When the target is multiclass, 'calibration', 'threshold', 'manifold' and 'rfe'
      plots are not available.
  
  -   When the 'max_features' parameter of a trained model object is not equal to
      the number of samples in training set, the 'rfe' plot is not available.
docstr_tok: ["This","function","analyzes","the","performance","of","a","trained","model","on","holdout","set",".","It","may","require","re-training","the","model","in","certain","cases",".","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","'",")",">",">",">","plot_model","(","lr",",","plot","=","'auc","'",")","estimator",":","scikit-learn","compatible","object","Trained","model","object","plot",":","str",",","default","=","'auc'","List","of","available","plots","(","ID","-","Name",")",":","*","'pipeline","'","-","Schematic","drawing","of","the","preprocessing","pipeline","*","'auc","'","-","Area","Under","the","Curve","*","'threshold","'","-","Discrimination","Threshold","*","'pr","'","-","Precision","Recall","Curve","*","'confusion_matrix","'","-","Confusion","Matrix","*","'error","'","-","Class","Prediction","Error","*","'class_report","'","-","Classification","Report","*","'boundary","'","-","Decision","Boundary","*","'rfe","'","-","Recursive","Feature","Selection","*","'learning","'","-","Learning","Curve","*","'manifold","'","-","Manifold","Learning","*","'calibration","'","-","Calibration","Curve","*","'vc","'","-","Validation","Curve","*","'dimension","'","-","Dimension","Learning","*","'feature","'","-","Feature","Importance","*","'feature_all","'","-","Feature","Importance","(","All",")","*","'parameter","'","-","Model","Hyperparameter","*","'lift","'","-","Lift","Curve","*","'gain","'","-","Gain","Chart","*","'tree","'","-","Decision","Tree","*","'ks","'","-","KS","Statistic","Plot","scale",":","float",",","default","=","1","The","resolution","scale","of","the","figure",".","save",":","bool",",","default","=","False","When","set","to","True",",","plot","is","saved","in","the","current","working","directory",".","fold",":","int","or","scikit-learn","compatible","CV","generator",",","default","=","None","Controls","cross-validation",".","If","None",",","the","CV","generator","in","the","``","fold_strategy","``","parameter","of","the","``","setup","``","function","is","used",".","When","an","integer","is","passed",",","it","is","interpreted","as","the","'n_splits","'","parameter","of","the","CV","generator","in","the","``","setup","``","function",".","fit_kwargs",":","dict",",","default","=","{","}","(","empty","dict",")","Dictionary","of","arguments","passed","to","the","fit","method","of","the","model",".","plot_kwargs",":","dict",",","default","=","{","}","(","empty","dict",")","Dictionary","of","arguments","passed","to","the","visualizer","class",".","-","pipeline",":","fontsize","-",">","int","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",".","verbose",":","bool",",","default","=","True","When","set","to","False",",","progress","bar","is","not","displayed",".","display_format",":","str",",","default","=","None","To","display","plots","in","Streamlit","(","https",":","\/\/www.streamlit.io\/",")",",","set","this","to","'streamlit","'",".","Currently",",","not","all","plots","are","supported",".","Returns",":","Path","to","saved","file",",","if","any",".","Warnings","--","--","--","--","-","Estimators","that","does","not","support","'predict_proba","'","attribute","can","not","be","used","for","'AUC","'","and","'calibration","'","plots",".","-","When","the","target","is","multiclass",",","'calibration","'",",","'threshold","'",",","'manifold","'","and","'rfe'","plots","are","not","available",".","-","When","the","'max_features","'","parameter","of","a","trained","model","object","is","not","equal","to","the","number","of","samples","in","training","set",",","the","'rfe","'","plot","is","not","available","."]
code: def plot_model(
      self,
      estimator,
      plot: str = "auc",
      scale: float = 1,
      save: bool = False,
      fold: Optional[Union[int, Any]] = None,
      fit_kwargs: Optional[dict] = None,
      plot_kwargs: Optional[dict] = None,
      groups: Optional[Union[str, Any]] = None,
      verbose: bool = True,
      display_format: Optional[str] = None,
  ) -> Optional[str]:
      """
      This function analyzes the performance of a trained model on holdout set.
      It may require re-training the model in certain cases.
  
      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')
      >>> plot_model(lr, plot = 'auc')
  
  
      estimator: scikit-learn compatible object
          Trained model object
  
  
      plot: str, default = 'auc'
          List of available plots (ID - Name):
  
          * 'pipeline' - Schematic drawing of the preprocessing pipeline
          * 'auc' - Area Under the Curve
          * 'threshold' - Discrimination Threshold
          * 'pr' - Precision Recall Curve
          * 'confusion_matrix' - Confusion Matrix
          * 'error' - Class Prediction Error
          * 'class_report' - Classification Report
          * 'boundary' - Decision Boundary
          * 'rfe' - Recursive Feature Selection
          * 'learning' - Learning Curve
          * 'manifold' - Manifold Learning
          * 'calibration' - Calibration Curve
          * 'vc' - Validation Curve
          * 'dimension' - Dimension Learning
          * 'feature' - Feature Importance
          * 'feature_all' - Feature Importance (All)
          * 'parameter' - Model Hyperparameter
          * 'lift' - Lift Curve
          * 'gain' - Gain Chart
          * 'tree' - Decision Tree
          * 'ks' - KS Statistic Plot
  
  
      scale: float, default = 1
          The resolution scale of the figure.
  
  
      save: bool, default = False
          When set to True, plot is saved in the current working directory.
  
  
      fold: int or scikit-learn compatible CV generator, default = None
          Controls cross-validation. If None, the CV generator in the ``fold_strategy``
          parameter of the ``setup`` function is used. When an integer is passed,
          it is interpreted as the 'n_splits' parameter of the CV generator in the
          ``setup`` function.
  
  
      fit_kwargs: dict, default = {} (empty dict)
          Dictionary of arguments passed to the fit method of the model.
  
  
      plot_kwargs: dict, default = {} (empty dict)
          Dictionary of arguments passed to the visualizer class.
              - pipeline: fontsize -> int
  
  
      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.
  
  
      verbose: bool, default = True
          When set to False, progress bar is not displayed.
  
  
      display_format: str, default = None
          To display plots in Streamlit (https://www.streamlit.io/), set this to 'streamlit'.
          Currently, not all plots are supported.
  
  
      Returns:
          Path to saved file, if any.
  
  
      Warnings
      --------
      -   Estimators that does not support 'predict_proba' attribute cannot be used for
          'AUC' and 'calibration' plots.
  
      -   When the target is multiclass, 'calibration', 'threshold', 'manifold' and 'rfe'
          plots are not available.
  
      -   When the 'max_features' parameter of a trained model object is not equal to
          the number of samples in training set, the 'rfe' plot is not available.
  
      """
  
      return super().plot_model(
          estimator=estimator,
          plot=plot,
          scale=scale,
          save=save,
          fold=fold,
          fit_kwargs=fit_kwargs,
          plot_kwargs=plot_kwargs,
          groups=groups,
          verbose=verbose,
          display_format=display_format,
      )
  
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 13 for calling the ClassificationExperiment obj's underlying member method code with example usage: obj.plot_model(estimator, plot, scale, save, fold, fit_kwargs, plot_kwargs, groups, verbose, display_format) and returns: super