code: def roc(df, y_col, y_hat_col, thresh=0.5):
      from sklearn.metrics import roc_curve
      import matplotlib.pyplot as plt
  
      if isinstance(df, pyspark.sql.dataframe.DataFrame):
          df = df.select([y_col, y_hat_col]).toPandas()
  
      def f2i(X):
          return [int(x > thresh) for x in X]
  
      y, y_hat = f2i(df[y_col]), df[y_hat_col]
      fpr, tpr, thresholds = roc_curve(y, y_hat)
      plt.plot(fpr, tpr)
      plt.xlabel("False Positive Rate", fontsize=20)
      plt.ylabel("True Positive Rate", fontsize=20)
  
file_path: SynapseML/core/src/main/python/synapse/ml/plot/plot.py
imports: import sys
  import pyspark
  from pyspark import SparkContext
  from pyspark import sql
  from pyspark.sql import DataFrame
  import warnings
  import numpy
  import itertools
label_desc: Use image node_id 2 for calling a global function with example usage: roc(df, y_col, y_hat_col, thresh) and returns: unknown