docstr: This function takes a trained model object and returns an interpretation plot
  based on the test / hold-out set.
  
  This function is implemented based on the SHAP (SHapley Additive exPlanations),
  which is a unified approach to explain the output of any machine learning model.
  SHAP connects game theory with local explanations.
  
  For more information: https://shap.readthedocs.io/en/latest/
  
  For more information on Partial Dependence Plot: https://github.com/SauceCat/PDPbox
  
  
  Example
  --------
  >>> from pycaret.datasets import get_data
  >>> boston = get_data('boston')
  >>> from pycaret.regression import *
  >>> exp = setup(data = boston,  target = 'medv')
  >>> xgboost = create_model('xgboost')
  >>> interpret_model(xgboost)
  
  
  estimator: scikit-learn compatible object
      Trained model object
  
  
  plot : str, default = 'summary'
      Abbreviation of type of plot. The current list of plots supported
      are (Plot - Name):
  
      * 'summary' - Summary Plot using SHAP
      * 'correlation' - Dependence Plot using SHAP
      * 'reason' - Force Plot using SHAP
      * 'pdp' - Partial Dependence Plot
      * 'msa' - Morris Sensitivity Analysis
      * 'pfi' - Permutation Feature Importance
  
  
  feature: str, default = None
      This parameter is only needed when plot = 'correlation' or 'pdp'.
      By default feature is set to None which means the first column of the
      dataset will be used as a variable. A feature parameter must be passed
      to change this.
  
  
  observation: integer, default = None
      This parameter only comes into effect when plot is set to 'reason'. If no
      observation number is provided, it will return an analysis of all observations
      with the option to select the feature on x and y axes through drop down
      interactivity. For analysis at the sample level, an observation parameter must
      be passed with the index value of the observation in test / hold-out set.
  
  
  use_train_data: bool, default = False
      When set to true, train data will be used for plots, instead
      of test data.
  
  
  X_new_sample: pd.DataFrame, default = None
      Row from an out-of-sample dataframe (neither train nor test data) to be plotted.
      The sample must have the same columns as the raw input train data, and it is transformed
      by the preprocessing pipeline automatically before plotting.
  
  
  y_new_sample: pd.DataFrame, default = None
      Row from an out-of-sample dataframe (neither train nor test data) to be plotted.
      The sample must have the same columns as the raw input label data, and it is transformed
      by the preprocessing pipeline automatically before plotting.
  
  
  save: string or bool, default = False
      When set to True, Plot is saved as a 'png' file in current working directory.
      When a path destination is given, Plot is saved as a 'png' file the given path to the directory of choice.
  
  
  **kwargs:
      Additional keyword arguments to pass to the plot.
  
  
  Returns:
      None
docstr_tok: ["This","function","takes","a","trained","model","object","and","returns","an","interpretation","plot","based","on","the","test","\/","hold-out","set",".","This","function","is","implemented","based","on","the","SHAP","(","SHapley","Additive","exPlanations",")",",","which","is","a","unified","approach","to","explain","the","output","of","any","machine","learning","model",".","SHAP","connects","game","theory","with","local","explanations",".","For","more","information",":","https",":","\/\/shap.readthedocs.io\/en\/latest\/","For","more","information","on","Partial","Dependence","Plot",":","https",":","\/\/github.com\/SauceCat\/PDPbox","Example","--","--","--","--",">",">",">","from","pycaret.datasets","import","get_data",">",">",">","boston","=","get_data","(","'boston","'",")",">",">",">","from","pycaret.regression","import","*",">",">",">","exp","=","setup","(","data","=","boston",",","target","=","'medv","'",")",">",">",">","xgboost","=","create_model","(","'xgboost","'",")",">",">",">","interpret_model","(","xgboost",")","estimator",":","scikit-learn","compatible","object","Trained","model","object","plot",":","str",",","default","=","'summary'","Abbreviation","of","type","of","plot",".","The","current","list","of","plots","supported","are","(","Plot","-","Name",")",":","*","'summary","'","-","Summary","Plot","using","SHAP","*","'correlation","'","-","Dependence","Plot","using","SHAP","*","'reason","'","-","Force","Plot","using","SHAP","*","'pdp","'","-","Partial","Dependence","Plot","*","'msa","'","-","Morris","Sensitivity","Analysis","*","'pfi","'","-","Permutation","Feature","Importance","feature",":","str",",","default","=","None","This","parameter","is","only","needed","when","plot","=","'correlation","'","or","'pdp","'",".","By","default","feature","is","set","to","None","which","means","the","first","column","of","the","dataset","will","be","used","as","a","variable",".","A","feature","parameter","must","be","passed","to","change","this",".","observation",":","integer",",","default","=","None","This","parameter","only","comes","into","effect","when","plot","is","set","to","'reason","'",".","If","no","observation","number","is","provided",",","it","will","return","an","analysis","of","all","observations","with","the","option","to","select","the","feature","on","x","and","y","axes","through","drop","down","interactivity",".","For","analysis","at","the","sample","level",",","an","observation","parameter","must","be","passed","with","the","index","value","of","the","observation","in","test","\/","hold-out","set",".","use_train_data",":","bool",",","default","=","False","When","set","to","true",",","train","data","will","be","used","for","plots",",","instead","of","test","data",".","X_new_sample",":","pd.DataFrame",",","default","=","None","Row","from","an","out-of-sample","dataframe","(","neither","train","nor","test","data",")","to","be","plotted",".","The","sample","must","have","the","same","columns","as","the","raw","input","train","data",",","and","it","is","transformed","by","the","preprocessing","pipeline","automatically","before","plotting",".","y_new_sample",":","pd.DataFrame",",","default","=","None","Row","from","an","out-of-sample","dataframe","(","neither","train","nor","test","data",")","to","be","plotted",".","The","sample","must","have","the","same","columns","as","the","raw","input","label","data",",","and","it","is","transformed","by","the","preprocessing","pipeline","automatically","before","plotting",".","save",":","string","or","bool",",","default","=","False","When","set","to","True",",","Plot","is","saved","as","a","'png","'","file","in","current","working","directory",".","When","a","path","destination","is","given",",","Plot","is","saved","as","a","'png","'","file","the","given","path","to","the","directory","of","choice",".","*","*","kwargs",":","Additional","keyword","arguments","to","pass","to","the","plot",".","Returns",":","None"]
code: def interpret_model(
      self,
      estimator,
      plot: str = "summary",
      feature: Optional[str] = None,
      observation: Optional[int] = None,
      use_train_data: bool = False,
      X_new_sample: Optional[pd.DataFrame] = None,
      y_new_sample: Optional[
          pd.DataFrame
      ] = None,  # add for pfi explainer
      save: Union[str, bool] = False,
      **kwargs,
  ):
      """
      This function takes a trained model object and returns an interpretation plot
      based on the test / hold-out set.
  
      This function is implemented based on the SHAP (SHapley Additive exPlanations),
      which is a unified approach to explain the output of any machine learning model.
      SHAP connects game theory with local explanations.
  
      For more information: https://shap.readthedocs.io/en/latest/
  
      For more information on Partial Dependence Plot: https://github.com/SauceCat/PDPbox
  
  
      Example
      --------
      >>> from pycaret.datasets import get_data
      >>> boston = get_data('boston')
      >>> from pycaret.regression import *
      >>> exp = setup(data = boston,  target = 'medv')
      >>> xgboost = create_model('xgboost')
      >>> interpret_model(xgboost)
  
  
      estimator: scikit-learn compatible object
          Trained model object
  
  
      plot : str, default = 'summary'
          Abbreviation of type of plot. The current list of plots supported
          are (Plot - Name):
  
          * 'summary' - Summary Plot using SHAP
          * 'correlation' - Dependence Plot using SHAP
          * 'reason' - Force Plot using SHAP
          * 'pdp' - Partial Dependence Plot
          * 'msa' - Morris Sensitivity Analysis
          * 'pfi' - Permutation Feature Importance
  
  
      feature: str, default = None
          This parameter is only needed when plot = 'correlation' or 'pdp'.
          By default feature is set to None which means the first column of the
          dataset will be used as a variable. A feature parameter must be passed
          to change this.
  
  
      observation: integer, default = None
          This parameter only comes into effect when plot is set to 'reason'. If no
          observation number is provided, it will return an analysis of all observations
          with the option to select the feature on x and y axes through drop down
          interactivity. For analysis at the sample level, an observation parameter must
          be passed with the index value of the observation in test / hold-out set.
  
  
      use_train_data: bool, default = False
          When set to true, train data will be used for plots, instead
          of test data.
  
  
      X_new_sample: pd.DataFrame, default = None
          Row from an out-of-sample dataframe (neither train nor test data) to be plotted.
          The sample must have the same columns as the raw input train data, and it is transformed
          by the preprocessing pipeline automatically before plotting.
  
  
      y_new_sample: pd.DataFrame, default = None
          Row from an out-of-sample dataframe (neither train nor test data) to be plotted.
          The sample must have the same columns as the raw input label data, and it is transformed
          by the preprocessing pipeline automatically before plotting.
  
  
      save: string or bool, default = False
          When set to True, Plot is saved as a 'png' file in current working directory.
          When a path destination is given, Plot is saved as a 'png' file the given path to the directory of choice.
  
  
      **kwargs:
          Additional keyword arguments to pass to the plot.
  
  
      Returns:
          None
  
      """
  
      return super().interpret_model(
          estimator=estimator,
          plot=plot,
          feature=feature,
          observation=observation,
          use_train_data=use_train_data,
          X_new_sample=X_new_sample,
          y_new_sample=y_new_sample,
          save=save,
          **kwargs,
      )
  
imports: import logging
  import re
  import time
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from joblib.memory import Memory
  from pycaret.containers.metrics.regression import get_all_metric_containers
  from pycaret.containers.models.regression 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.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.loggers.base_logger import BaseLogger
  from pycaret.utils.constants import DATAFRAME_LIKE, SEQUENCE_LIKE, TARGET_LIKE
  from pycaret.utils.generic import MLUsecase, highlight_setup
label_desc: Use image node_id 14 for calling the RegressionExperiment obj's underlying member method code with example usage: obj.interpret_model(estimator, plot, feature, observation, use_train_data, X_new_sample, y_new_sample, save) and returns: super