docstr: This function predicts ``Label`` and ``Score`` (probability of predicted
  class) using a trained model. When ``data`` is None, it predicts label and
  score on the holdout set.
  
  
  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')
  >>> pred_holdout = predict_model(lr)
  >>> pred_unseen = predict_model(lr, data = unseen_dataframe)
  
  
  estimator: scikit-learn compatible object
      Trained model object
  
  
  data: pandas.DataFrame
      Shape (n_samples, n_features). All features used during training
      must be available in the unseen dataset.
  
  
  probability_threshold: float, default = None
      Threshold for converting predicted probability to class label.
      Unless this parameter is set, it will default to the value set
      during model creation. If that wasn't set, the default will be 0.5
      for all classifiers. Only applicable for binary classification.
  
  
  encoded_labels: bool, default = False
      When set to True, will return labels encoded as an integer.
  
  
  raw_score: bool, default = False
      When set to True, scores for all labels will be returned.
  
  
  round: int, default = 4
      Number of decimal places the metrics in the score grid will be rounded to.
  
  
  verbose: bool, default = True
      When set to False, holdout score grid is not printed.
  
  
  Returns:
      pandas.DataFrame
  
  
  Warnings
  --------
  - The behavior of the ``predict_model`` is changed in version 2.1 without backward
  compatibility. As such, the pipelines trained using the version (<= 2.0), may not
  work for inference with version >= 2.1. You can either retrain your models with a
  newer version or downgrade the version for inference.
docstr_tok: ["This","function","predicts","``","Label","``","and","``","Score","``","(","probability","of","predicted","class",")","using","a","trained","model",".","When","``","data","``","is","None",",","it","predicts","label","and","score","on","the","holdout","set",".","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","'",")",">",">",">","pred_holdout","=","predict_model","(","lr",")",">",">",">","pred_unseen","=","predict_model","(","lr",",","data","=","unseen_dataframe",")","estimator",":","scikit-learn","compatible","object","Trained","model","object","data",":","pandas.DataFrame","Shape","(","n_samples",",","n_features",")",".","All","features","used","during","training","must","be","available","in","the","unseen","dataset",".","probability_threshold",":","float",",","default","=","None","Threshold","for","converting","predicted","probability","to","class","label",".","Unless","this","parameter","is","set",",","it","will","default","to","the","value","set","during","model","creation",".","If","that","was","n't","set",",","the","default","will","be","0.5","for","all","classifiers",".","Only","applicable","for","binary","classification",".","encoded_labels",":","bool",",","default","=","False","When","set","to","True",",","will","return","labels","encoded","as","an","integer",".","raw_score",":","bool",",","default","=","False","When","set","to","True",",","scores","for","all","labels","will","be","returned",".","round",":","int",",","default","=","4","Number","of","decimal","places","the","metrics","in","the","score","grid","will","be","rounded","to",".","verbose",":","bool",",","default","=","True","When","set","to","False",",","holdout","score","grid","is","not","printed",".","Returns",":","pandas.DataFrame","Warnings","--","--","--","--","-","The","behavior","of","the","``","predict_model","``","is","changed","in","version","2.1","without","backward","compatibility",".","As","such",",","the","pipelines","trained","using","the","version","(","<","=","2.0",")",",","may","not","work","for","inference","with","version",">","=","2.1",".","You","can","either","retrain","your","models","with","a","newer","version","or","downgrade","the","version","for","inference","."]
code: def predict_model(
      self,
      estimator,
      data: Optional[pd.DataFrame] = None,
      probability_threshold: Optional[float] = None,
      encoded_labels: bool = False,
      raw_score: bool = False,
      round: int = 4,
      verbose: bool = True,
  ) -> pd.DataFrame:
      """
      This function predicts ``Label`` and ``Score`` (probability of predicted
      class) using a trained model. When ``data`` is None, it predicts label and
      score on the holdout set.
  
  
      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')
      >>> pred_holdout = predict_model(lr)
      >>> pred_unseen = predict_model(lr, data = unseen_dataframe)
  
  
      estimator: scikit-learn compatible object
          Trained model object
  
  
      data: pandas.DataFrame
          Shape (n_samples, n_features). All features used during training
          must be available in the unseen dataset.
  
  
      probability_threshold: float, default = None
          Threshold for converting predicted probability to class label.
          Unless this parameter is set, it will default to the value set
          during model creation. If that wasn't set, the default will be 0.5
          for all classifiers. Only applicable for binary classification.
  
  
      encoded_labels: bool, default = False
          When set to True, will return labels encoded as an integer.
  
  
      raw_score: bool, default = False
          When set to True, scores for all labels will be returned.
  
  
      round: int, default = 4
          Number of decimal places the metrics in the score grid will be rounded to.
  
  
      verbose: bool, default = True
          When set to False, holdout score grid is not printed.
  
  
      Returns:
          pandas.DataFrame
  
  
      Warnings
      --------
      - The behavior of the ``predict_model`` is changed in version 2.1 without backward
      compatibility. As such, the pipelines trained using the version (<= 2.0), may not
      work for inference with version >= 2.1. You can either retrain your models with a
      newer version or downgrade the version for inference.
  
      """
  
      return super().predict_model(
          estimator=estimator,
          data=data,
          probability_threshold=probability_threshold,
          encoded_labels=encoded_labels,
          raw_score=raw_score,
          round=round,
          verbose=verbose,
      )
  
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 18 for calling the ClassificationExperiment obj's underlying member method code with example usage: obj.predict_model(estimator, data, probability_threshold, encoded_labels, raw_score, round, verbose) and returns: super