class_docstr: Calculate model-level model performance measures
  
  Parameters
  -----------
  model_type : {'regression', 'classification'}
      Model task type that is used to choose the proper performance measures.
  cutoff : float, optional
      Cutoff for predictions in classification models. Needed for measures like
      recall, precision, acc, f1 (default is `0.5`).
  
  Attributes
  -----------
  result : pd.DataFrame
      Main result attribute of an explanation.
  residuals : pd.DataFrame
      Residuals for `data`.
  model_type : {'regression', 'classification'}
      Model task type that is used to choose the proper performance measures.
  cutoff : float
      Cutoff for predictions in classification models.
  
  Notes
  --------
  - https://pbiecek.github.io/ema/modelPerformance.html
class_docstr_tok: ["Calculate","model-level","model","performance","measures","Parameters","--","--","--","--","--","-","model_type",":","{","'regression","'",",","'classification","'","}","Model","task","type","that","is","used","to","choose","the","proper","performance","measures",".","cutoff",":","float",",","optional","Cutoff","for","predictions","in","classification","models",".","Needed","for","measures","like","recall",",","precision",",","acc",",","f1","(","default","is","`","0.5","`",")",".","Attributes","--","--","--","--","--","-","result",":","pd.DataFrame","Main","result","attribute","of","an","explanation",".","residuals",":","pd.DataFrame","Residuals","for","`","data","`",".","model_type",":","{","'regression","'",",","'classification","'","}","Model","task","type","that","is","used","to","choose","the","proper","performance","measures",".","cutoff",":","float","Cutoff","for","predictions","in","classification","models",".","Notes","--","--","--","--","-","https",":","\/\/pbiecek.github.io\/ema\/modelPerformance.html"]
docstr: Plot the Model Performance explanation
  
  Parameters
  -----------
  objects : ModelPerformance object or array_like of ModelPerformance objects
      Additional objects to plot (default is `None`).
  geom: {'ecdf', 'roc', 'lift'}
      Type of plot determines how residuals shall be summarized.
  title : str, optional
      Title of the plot (default depends on the `type` attribute).
  show : bool, optional
      `True` shows the plot; `False` returns the plotly Figure object that can 
      be edited or saved using the `write_image()` method (default is `True`).
  
  Returns
  -----------
  None or plotly.graph_objects.Figure
      Return figure that can be edited or saved. See `show` parameter.
docstr_tok: ["Plot","the","Model","Performance","explanation","Parameters","--","--","--","--","--","-","objects",":","ModelPerformance","object","or","array_like","of","ModelPerformance","objects","Additional","objects","to","plot","(","default","is","`","None","`",")",".","geom",":","{","'ecdf","'",",","'roc","'",",","'lift","'","}","Type","of","plot","determines","how","residuals","shall","be","summarized",".","title",":","str",",","optional","Title","of","the","plot","(","default","depends","on","the","`","type","`","attribute",")",".","show",":","bool",",","optional","`","True","`","shows","the","plot",";","`","False","`","returns","the","plotly","Figure","object","that","can","be","edited","or","saved","using","the","`","write_image","(",")","`","method","(","default","is","`","True","`",")",".","Returns","--","--","--","--","--","-","None","or","plotly.graph_objects.Figure","Return","figure","that","can","be","edited","or","saved",".","See","`","show","`","parameter","."]
code: def plot(self, objects=None, geom="ecdf", title=None, show=False):
      """Plot the Model Performance explanation
  
      Parameters
      -----------
      objects : ModelPerformance object or array_like of ModelPerformance objects
          Additional objects to plot (default is `None`).
      geom: {'ecdf', 'roc', 'lift'}
          Type of plot determines how residuals shall be summarized.
      title : str, optional
          Title of the plot (default depends on the `type` attribute).
      show : bool, optional
          `True` shows the plot; `False` returns the plotly Figure object that can
          be edited or saved using the `write_image()` method (default is `True`).
  
      Returns
      -----------
      None or plotly.graph_objects.Figure
          Return figure that can be edited or saved. See `show` parameter.
      """
  
      if geom not in ("ecdf", "roc", "lift"):
          raise TypeError(
              "geom should be one of {'ecdf', 'roc', 'lift'}"
          )
  
      # are there any other objects to plot?
      if objects is None:
          _df_list = [self.residuals.copy()]
      elif isinstance(
          objects, self.__class__
      ):  # allow for objects to be a single element
          _df_list = [self.residuals.copy(), objects.residuals.copy()]
      elif isinstance(
          objects, (list, tuple)
      ):  # objects as tuple or array
          _df_list = [self.residuals.copy()]
          for ob in objects:
              _global_checks.global_check_object_class(
                  ob, self.__class__
              )
              _df_list += [ob.residuals.copy()]
      else:
          _global_checks.global_raise_objects_class(
              objects, self.__class__
          )
  
      colors = _theme.get_default_colors(len(_df_list), "line")
  
      if geom == "ecdf":
          fig = plot.plot_ecdf(_df_list, colors, title)
      elif geom == "roc":
          fig = plot.plot_roc(_df_list, colors, title)
      elif geom == "lift":
          fig = plot.plot_lift(_df_list, colors, title)
      else:
          raise TypeError(
              "geom should be one of {'ecdf', 'roc', 'lift'}"
          )
  
      if show:
          fig.show(config=_theme.get_default_config())
      else:
          return fig
  
file_path: DALEX/python/dalex/dalex/model_explanations/_model_performance/object.py
imports: import numpy
  import pandas
  from .None import plot, utils
  from ...None import _theme, _global_checks
  from ..._explanation import Explanation
label_desc: Use image node_id 4 for calling the ModelPerformance obj's underlying member method code with example usage: obj.plot(objects, geom, title, show) and returns: fig