code: def plot_roc_curve(model, partition):
      r"""Display ROC Curves with Cross-Validation.
  
      Parameters
      ----------
      model : alphapy.Model
          The model object with plotting specifications.
      partition : alphapy.Partition
          Reference to the dataset.
  
      Returns
      -------
      None : None
  
      References
      ----------
  
      http://scikit-learn.org/stable/modules/model_evaluation.html#receiver-operating-characteristic-roc
  
      """
  
      logger.info("Generating ROC Curves")
      pstring = datasets[partition]
  
      # For classification only
  
      if model.specs["model_type"] != ModelType.classification:
          logger.info("ROC Curves are for classification only")
          return None
  
      # Get X, Y for correct partition.
  
      X, y = get_partition_data(model, partition)
  
      # Initialize plot parameters.
  
      plt.style.use("classic")
      plt.figure()
      lw = 2
  
      # Plot a ROC Curve for each algorithm.
  
      for algo in model.algolist:
          logger.info("ROC Curve for Algorithm: %s", algo)
          # compute ROC curve and ROC area for each class
          probas = model.probas[(algo, partition)]
          fpr, tpr, _ = roc_curve(y, probas)
          roc_auc = auc(fpr, tpr)
          plt.plot(
              fpr,
              tpr,
              lw=lw,
              label="%s (area = %0.2f)" % (algo, roc_auc),
          )
  
      # draw the luck line
      plt.plot([0, 1], [0, 1], linestyle="--", color="k", label="Luck")
      # define plot characteristics
      plt.xlim([-0.05, 1.05])
      plt.ylim([-0.05, 1.05])
      plt.xlabel("False Positive Rate")
      plt.ylabel("True Positive Rate")
      title = BSEP.join([algo, "ROC Curve [", pstring, "]"])
      plt.title(title)
      plt.legend(loc="lower right")
      # save chart
      plot_dir = get_plot_directory(model)
      write_plot("matplotlib", plt, "roc_curve", pstring, plot_dir)
  
imports: from alphapy.estimators import get_estimators
  from alphapy.globals import BSEP, PSEP, SSEP, USEP
  from alphapy.globals import ModelType
  from alphapy.globals import Partition, datasets
  from alphapy.globals import Q1, Q3
  from alphapy.utilities import remove_list_items
  from bokeh.plotting import figure, show, output_file
  import itertools
  import logging
  import math
  import matplotlib
  import matplotlib.pyplot
  from mpl_toolkits.mplot3d import Axes3D
  import numpy
  import pandas
  from scipy import interp
  import seaborn
  from sklearn.calibration import calibration_curve
  from sklearn.inspection import partial_dependence
  from sklearn.inspection import plot_partial_dependence
  from sklearn.metrics import auc
  from sklearn.metrics import confusion_matrix
  from sklearn.metrics import roc_curve
  from sklearn.model_selection import cross_val_score
  from sklearn.model_selection import learning_curve
  from sklearn.model_selection import StratifiedKFold
  from sklearn.model_selection import train_test_split
  from sklearn.model_selection import validation_curve
  from sklearn.utils.multiclass import unique_labels
label_desc: Use image node_id 8 for calling a global function with example usage: plot_roc_curve(model, partition) and returns: None