code: def test_roc_curve(self):
      # Example from p.864
      # https://ccrma.stanford.edu/workshops/mir2009/references/ROCintro.pdf
      y = turicreate.SArray(
          [1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0]
      )
      yhat = turicreate.SArray(
          [
              0.9,
              0.8,
              0.7,
              0.6,
              0.55,
              0.54,
              0.53,
              0.52,
              0.51,
              0.505,
              0.4,
              0.39,
              0.38,
              0.37,
              0.36,
              0.35,
              0.34,
              0.33,
              0.30,
              0.1,
          ]
      )
  
      true_fpr = turicreate.SArray(
          [
              0,
              0,
              0,
              0.1,
              0.1,
              0.1,
              0.1,
              0.2,
              0.3,
              0.3,
              0.4,
              0.4,
              0.5,
              0.5,
              0.6,
              0.7,
              0.8,
              0.8,
              0.9,
              0.9,
              1.0,
          ]
      )
      true_tpr = turicreate.SArray(
          [
              0,
              0.1,
              0.2,
              0.2,
              0.3,
              0.4,
              0.5,
              0.5,
              0.5,
              0.6,
              0.6,
              0.7,
              0.7,
              0.8,
              0.8,
              0.8,
              0.8,
              0.9,
              0.9,
              1.0,
              1.0,
          ]
      )
  
      res = turicreate.toolkits.evaluation.roc_curve(y, yhat)
      points = res[["fpr", "tpr"]].unique().sort(["fpr", "tpr"])
      self.assertTrue(all(points["fpr"] == true_fpr))
      self.assertTrue(all(points["tpr"] == true_tpr))
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  from turicreate.toolkits._main import ToolkitError
  import math
  from numpy import inf
  import numpy
label_desc: Use image node_id 10 for calling the MetricsTest obj's underlying member method code with example usage: obj.test_roc_curve() without return types